function display_help() { $info = plugin_mactrack_version(); print "MacTrack Import OUI Database v" . $info["version"] . ", " . COPYRIGHT_YEARS . "\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"; }
function mactrack_check_upgrade () { global $config; if (defined('CACTI_BASE_PATH')) { $config["base_path"] = CACTI_BASE_PATH; } include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_functions.php"); $files = array('index.php', 'plugins.php', 'mactrack_devices.php'); if (isset($_SERVER['PHP_SELF']) && !in_array(basename($_SERVER['PHP_SELF']), $files)) { return; } $current = plugin_mactrack_version(); $current = $current['version']; $old = db_fetch_row("SELECT * FROM plugin_config WHERE directory='mactrack'"); if (!sizeof($old) || $current != $old["version"]) { /* if the plugin is installed and/or active */ if (!sizeof($old) || $old["status"] == 1 || $old["status"] == 4) { /* re-register the hooks */ plugin_mactrack_install(); if (api_plugin_is_enabled('mactrack')) { # may sound ridiculous, but enables new hooks api_plugin_enable_hooks('mactrack'); } /* perform a database upgrade */ mactrack_database_upgrade(); } if (read_config_option("mt_convert_readstrings", true) != "on") { convert_readstrings(); } /* rebuild the scanning functions */ mactrack_rebuild_scanning_funcs(); /* update the plugin information */ $info = plugin_mactrack_version(); $id = db_fetch_cell("SELECT id FROM plugin_config WHERE directory='mactrack'"); db_execute("UPDATE plugin_config SET name='" . $info["longname"] . "', author='" . $info["author"] . "', webpage='" . $info["homepage"] . "', version='" . $info["version"] . "' WHERE id='$id'"); } }
function display_help() { $info = plugin_mactrack_version(); print "Network MacTracker Version " . $info['version'] . ", " . COPYRIGHT_YEARS . "\n\n"; print "usage: mactrack_device.php -id=host_id [-w] [-d] [-h] [--help] [-v] [--version]\n\n"; print "-id=host_id - the mac_track_devices host_id to scan\n"; print "-d | --debug - Display verbose output during execution\n"; print "-w | --web - Display web compatible output during execution\n"; print "-t - Test mode, don't log a process id and interfere with system\n"; print "-v --version - Display this help message\n"; print "-h --help - display this help message\n"; }
function display_help() { $info = plugin_mactrack_version(); print "Network MacTracker IP Resolver Version " . $info['version'] . ", " . COPYRIGHT_YEARS . "\n"; print "usage: mactrack_resolver.php [-sid=ID] [-d] [-h] [--help] [-v] [--version]\n\n"; print "-sid=ID - The site id to resolve for\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 mactrack_check_upgrade() { global $config; $files = array('index.php', 'plugins.php', 'mactrack_devices.php'); if (isset($_SERVER['PHP_SELF']) && !in_array(basename($_SERVER['PHP_SELF']), $files)) { return; } include_once $config['base_path'] . '/plugins/mactrack/lib/mactrack_functions.php'; $current = plugin_mactrack_version(); $current = $current['version']; $old = db_fetch_row("SELECT * FROM plugin_config WHERE directory='mactrack'"); if (!sizeof($old) || $current != $old['version']) { /* if the plugin is installed and/or active */ if (!sizeof($old) || $old['status'] == 1 || $old['status'] == 4) { /* re-register the hooks */ plugin_mactrack_install(); if (api_plugin_is_enabled('mactrack')) { # may sound ridiculous, but enables new hooks api_plugin_enable_hooks('mactrack'); } /* perform a database upgrade */ mactrack_database_upgrade(); } if (read_config_option('mt_convert_readstrings', true) != 'on') { convert_readstrings(); } // If are realms are not present in plugin_realms recreate them with the old realm ids (minus 100) so that upgraded installs are not broken if (!db_fetch_cell("SELECT id FROM plugin_realms WHERE plugin = 'mactrack'")) { db_execute("INSERT INTO plugin_realms (id, plugin, file, display) VALUES (2020, 'mactrack', 'mactrack_view_ips.php,mactrack_view_arp.php,mactrack_view_macs.php,mactrack_view_sites.php,mactrack_view_devices.php,mactrack_view_interfaces.php,mactrack_view_graphs.php,mactrack_ajax.php', 'Plugin -> MacTrack Viewer')"); db_execute("INSERT INTO plugin_realms (id, plugin, file, display) VALUES (2021, 'mactrack', 'mactrack_ajax_admin.php,mactrack_devices.php,mactrack_snmp.php,mactrack_sites.php,mactrack_device_types.php,mactrack_utilities.php,mactrack_macwatch.php,mactrack_macauth.php,mactrack_vendormacs.php', 'Plugin -> MacTrack Administrator')"); } /* rebuild the scanning functions */ mactrack_rebuild_scanning_funcs(); /* update the plugin information */ $info = plugin_mactrack_version(); $id = db_fetch_cell("SELECT id FROM plugin_config WHERE directory='mactrack'"); db_execute("UPDATE plugin_config\n\t\t\tSET name='" . $info['longname'] . "',\n\t\t\tauthor='" . $info['author'] . "',\n\t\t\twebpage='" . $info['homepage'] . "',\n\t\t\tversion='" . $info['version'] . "'\n\t\t\tWHERE id='{$id}'"); } }
function display_help() { $info = plugin_mactrack_version(); print 'MacTrack Master Poller v' . $info['version'] . ', ' . COPYRIGHT_YEARS . "\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"; }