function display_help () {
	$version = mactrack_version();
	print "MacTrack Import OUI Database v" . $version["version"] . ", Copyright 2004-2010 - The Cacti Group\n\n";
	print "usage: mactrack_import_ouidb.php [-f=ouifile] [-h] [--help] [-v] [-V] [--version]\n\n";
	print "-f='outdbfile'   - Specify the location of the OUI dataabase file.  If your system\n";
	print "                   does not allow native access to the IEEE via http, you can manually\n";
	print "                   download the file, and then import it using this option.\n";
	print "-v -V --version  - Display this help message\n";
	print "-h --help        - Display this help message\n";
}
Exemple #2
0
function plugin_mactrack_version () {
	return mactrack_version();
}
function mactrack_mail($to, $from, $fromname, $subject, $message, $headers = '')
{
    global $config;
    include_once $config['base_path'] . '/plugins/settings/include/mailer.php';
    $subject = trim($subject);
    $message = str_replace('<SUBJECT>', $subject, $message);
    $how = read_config_option('settings_how');
    if ($how < 0 && $how > 2) {
        $how = 0;
    }
    if ($how == 0) {
        $Mailer = new Mailer(array('Type' => 'PHP'));
    } else {
        if ($how == 1) {
            $sendmail = read_config_option('settings_sendmail_path');
            $Mailer = new Mailer(array('Type' => 'DirectInject', 'DirectInject_Path' => $sendmail));
        } else {
            if ($how == 2) {
                $smtp_host = read_config_option('settings_smtp_host');
                $smtp_port = read_config_option('settings_smtp_port');
                $smtp_username = read_config_option('settings_smtp_username');
                $smtp_password = read_config_option('settings_smtp_password');
                $Mailer = new Mailer(array('Type' => 'SMTP', 'SMTP_Host' => $smtp_host, 'SMTP_Port' => $smtp_port, 'SMTP_Username' => $smtp_username, 'SMTP_Password' => $smtp_password));
            }
        }
    }
    if ($from == '') {
        $from = read_config_option('mt_from_email');
        $fromname = read_config_option('mt_from_name');
        if ($from == '') {
            if (isset($_SERVER['HOSTNAME'])) {
                $from = 'Cacti@' . $_SERVER['HOSTNAME'];
            } else {
                $from = '*****@*****.**';
            }
        }
        if ($fromname == '') {
            $fromname = 'Cacti';
        }
        $from = $Mailer->email_format($fromname, $from);
        if ($Mailer->header_set('From', $from) === false) {
            cacti_log('ERROR: ' . $Mailer->error(), true, "MACTRACK");
            return $Mailer->error();
        }
    } else {
        $from = $Mailer->email_format($fromname, $from);
        if ($Mailer->header_set('From', $from) === false) {
            cacti_log('ERROR: ' . $Mailer->error(), true, "MACTRACK");
            return $Mailer->error();
        }
    }
    if ($to == '') {
        return 'Mailer Error: No <b>TO</b> address set!!<br>If using the <i>Test Mail</i> link, please set the <b>Alert e-mail</b> setting.';
    }
    $to = explode(',', $to);
    foreach ($to as $t) {
        if (trim($t) != '' && !$Mailer->header_set('To', $t)) {
            cacti_log('ERROR: ' . $Mailer->error(), true, "MACTRACK");
            return $Mailer->error();
        }
    }
    $wordwrap = read_config_option('settings_wordwrap');
    if ($wordwrap == '') {
        $wordwrap = 76;
    } else {
        if ($wordwrap > 9999) {
            $wordwrap = 9999;
        } else {
            if ($wordwrap < 0) {
                $wordwrap = 76;
            }
        }
    }
    $Mailer->Config['Mail']['WordWrap'] = $wordwrap;
    if (!$Mailer->header_set('Subject', $subject)) {
        cacti_log('ERROR: ' . $Mailer->error(), true, "MACTRACK");
        return $Mailer->error();
    }
    $text = array('text' => '', 'html' => '');
    $text['html'] = $message . '<br>';
    $text['text'] = strip_tags(str_replace('<br>', "\n", $message));
    $v = mactrack_version();
    $Mailer->header_set('X-Mailer', 'Cacti-MacTrack-v' . $v['version']);
    $Mailer->header_set('User-Agent', 'Cacti-MacTrack-v' . $v['version']);
    if ($Mailer->send($text) == false) {
        cacti_log('ERROR: ' . $Mailer->error(), true, "MACTRACK");
        return $Mailer->error();
    }
    return '';
}
function display_help()
{
    $version = mactrack_version();
    print 'MacTrack Convert Partitioned v' . $version['version'] . ", Copyright 2004-2016 - The Cacti Group\n\n";
    print "usage: mactrack_convert.php [-d] [-h] [--help] [-v] [--version]\n\n";
    print "--engine=N    - Database Engine.  Value are 'MyISAM' or 'InnoDB'\n";
    print "--days=30     - Days to Retain.  Valid Range is 10-360\n";
    print "-d | --debug  - Display verbose output during execution\n";
    print "-v --version  - Display this help message\n";
    print "-h --help     - Display this help message\n";
}
function display_help () {
	$version = mactrack_version();
	print "MacTrack Master Poller v" . $version["version"] . ", Copyright 2004-2010 - The Cacti Group\n\n";
	print "usage: poller_mactrack.php [-sid=site_id] [-d] [-h] [--help] [-v] [--version]\n\n";
	print "-sid=site_id  - The mac_track_sites site_id to scan\n";
	print "-w | --web    - Display output suitable for the web\n";
	print "-f | --force  - Force the execution of a collection process\n";
	print "-d | --debug  - Display verbose output during execution\n";
	print "-v --version  - Display this help message\n";
	print "-h --help     - Display this help message\n";
}