Exemple #1
0
function mactrack_config_settings () {
	global $tabs, $settings, $snmp_versions, $mactrack_poller_frequencies,
	$mactrack_data_retention, $mactrack_macauth_frequencies, $mactrack_update_policies;

	$tabs["mactrack"] = "Mactrack";

	$settings["mactrack"] = array(
		"mactrack_hdr_timing" => array(
			"friendly_name" => "General Settings",
			"method" => "spacer",
			),
		"mt_collection_timing" => array(
			"friendly_name" => "Scanning Frequency",
			"description" => "Choose when to collect MAC and IP Addresses and Interface statistics from your network devices.",
			"method" => "drop_array",
			"default" => "disabled",
			"array" => $mactrack_poller_frequencies,
			),
		"mt_processes" => array(
			"friendly_name" => "Concurrent Processes",
			"description" => "Specify how many devices will be polled simultaneously until all devices have been polled.",
			"default" => "7",
			"method" => "textbox",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_script_runtime" => array(
			"friendly_name" => "Scanner Max Runtime",
			"description" => "Specify the number of minutes a device scanning function will allowed to run prior to the system assuming it has been completed.  This setting will correct for abended scanning jobs.",
			"default" => "20",
			"method" => "textbox",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_base_time" => array(
			"friendly_name" => "Start Time for Data Collection",
			"description" => "When would you like the first data collection to take place.  All future data collection times will be based upon this start time.  A good example would be 12:00AM.",
			"default" => "1:00am",
			"method" => "textbox",
			"max_length" => "10",
			"size" => "8"
			),
		"mt_maint_time" => array(
			"friendly_name" => "Database Maintenance Time",
			"description" => "When should old database records be removed from the database.  Please note that no access will be permitted to the port database while this action is taking place.",
			"default" => "12:00am",
			"method" => "textbox",
			"max_length" => "10",
			"size" => "8"
			),
		"mt_data_retention" => array(
			"friendly_name" => "Data Retention",
			"description" => "How long should port MAC details be retained in the database.",
			"method" => "drop_array",
			"default" => "2weeks",
			"array" => $mactrack_data_retention,
			),
		"mt_ignorePorts_delim" => array(
			"friendly_name" => "Switch Level Ignore Ports Delimiter",
			"description" => "What delimiter should MacTrack use when parsing the Ignore Ports string for each switch.",
			"method" => "drop_array",
			"default" => "-1",
			"array" => array("-1" => "Auto Detect", ":" => "Colon [:]", "|" => "Pipe [|]", " " => "Space [ ]")
			),
		"mt_mac_delim" => array(
			"friendly_name" => "Mac Address Delimiter",
			"description" => "How should each octet of the MAC address be delimited.",
			"method" => "drop_array",
			"default" => ":",
			"array" => array(":" => "Colon [:]", "-" => "Dash [-]")
			),
		"mt_ignorePorts" => array(
			"method" => "textbox",
			"friendly_name" => "Ports to Ignore",
			"description" => "Provide a regular expression of ifNames or ifDescriptions of ports to ignore in the interface list.  For example (Vlan|Loopback|Null).",
			"class" => "textAreaNotes",
			"defaults" => "(Vlan|Loopback|Null)",
			"max_length" => "255",
			"size" => "80"
			),
		"mactrack_hdr_rdns" => array(
			"friendly_name" => "DNS Settings",
			"method" => "spacer",
			),
		"mt_reverse_dns" => array(
			"friendly_name" => "Perform Reverse DNS Name Resolution",
			"description" => "Should MacTrack perform reverse DNS lookup of the IP addresses associated with ports. CAUTION: If DNS is not properly setup, this will slow scan time significantly.",
			"default" => "",
			"method" => "checkbox"
			),
		"mt_dns_primary" => array(
			"friendly_name" => "Primary DNS IP Address",
			"description" => "Enter the primary DNS IP Address to utilize for reverse lookups.",
			"method" => "textbox",
			"default" => "",
			"max_length" => "30",
			"size" => "18"
			),
		"mt_dns_secondary" => array(
			"friendly_name" => "Secondary DNS IP Address",
			"description" => "Enter the secondary DNS IP Address to utilize for reverse lookups.",
			"method" => "textbox",
			"default" => "",
			"max_length" => "30",
			"size" => "18"
			),
		"mt_dns_timeout" => array(
			"friendly_name" => "DNS Timeout",
			"description" => "Please enter the DNS timeout in milliseconds.  MacTrack uses a PHP based DNS resolver.",
			"method" => "textbox",
			"default" => "500",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_dns_prime_interval" => array(
			"friendly_name" => "DNS Prime Interval",
			"description" => "How often, in seconds do MacTrack scanning IP's need to be resolved to MAC addresses for DNS resolution.  Using a larger number when you have several thousand devices will increase performance.",
			"method" => "textbox",
			"default" => "120",
			"max_length" => "10",
			"size" => "4"
			),
		"mactrack_hdr_notification" => array(
			"friendly_name" => "Notification Settings",
			"method" => "spacer",
			),
		"mt_from_email" => array(
			"friendly_name" => "Source Address",
			"description" => "The source e-mail address for MacTrack e-mails.",
			"method" => "textbox",
			"default" => "*****@*****.**",
			"max_length" => "100",
			"size" => "30"
			),
		"mt_from_name" => array(
			"friendly_name" => "Source E-Mail Name",
			"description" => "The Source E-Mail name for MacTrack e-mails.",
			"method" => "textbox",
			"default" => "MACTrack Administrator",
			"max_length" => "100",
			"size" => "30"
			),
		"mt_macwatch_description" => array(
			"friendly_name" => "MacWatch Default Body",
			"description" => htmlspecialchars("The e-mail body preset for MacTrack MacWatch e-mails.  The body can contain " .
			"any valid html tags.  It also supports replacement tags that will be processed when sending an e-mail.  " .
			"Valid tags include <IP>, <MAC>, <TICKET>, <SITENAME>, <DEVICEIP>, <PORTNAME>, <PORTNUMBER>, <DEVICENAME>."),
			"method" => "textarea",
			"default" => "Mac Address <MAC> found at IP Address <IP> for Ticket Number: <TICKET>.<br>" .
			"The device is located at<br>Site: <SITENAME>, Device <DEVICENAME>, IP <DEVICEIP>, Port <PORTNUMBER>, " .
			"and Port Name <PORTNAME>",
			"class" => "textAreaNotes",
			"max_length" => "512",
			"textarea_rows" => "5",
			"textarea_cols" => "80",
			),
		"mt_macauth_emails" => array(
			"friendly_name" => "MacAuth Report E-Mail Addresses",
			"description" => "A comma delimited list of users to recieve the MacAuth e-mail notifications.",
			"method" => "textarea",
			"default" => "",
			"class" => "textAreaNotes",
			"max_length" => "255",
			"textarea_rows" => "5",
			"textarea_cols" => "80",
			),
		"mt_macauth_email_frequency" => array(
			"friendly_name" => "MacAuth Report Frequency",
			"description" => "How often will the MacAuth Reports be e-mailed.",
			"method" => "drop_array",
			"default" => "disabled",
			"array" => $mactrack_macauth_frequencies,
			),
		"mactrack_hdr_arpwatch" => array(
			"friendly_name" => "MacTrack Arpwatch Settings",
			"method" => "spacer",
			),
		"mt_arpwatch" => array(
			"friendly_name" => "Enable ArpWatch",
			"description" => "Should MacTrack also use ArpWatch data to supplement Mac to IP/DNS resolution?",
			"default" => "",
			"method" => "checkbox"
			),
		"mt_arpwatch_path" => array(
			"friendly_name" => "ArpWatch Database Path",
			"description" => "The location of the ArpWatch Database file on the Cacti server.",
			"method" => "filepath",
			"default" => "",
			"max_length" => "255",
			"size" => "60"
			),
		"mactrack_hdr_general" => array(
			"friendly_name" => "SNMP Presets",
			"method" => "spacer",
			),
		"mt_update_policy" => array(
			"friendly_name" => "Update Policy for SNMP Options",
			"description" => "Policy for synchronization of SNMP Options between Cacti devices and Mactrack Devices.",
			"method" => "drop_array",
			"default" => 1,
			"array" => $mactrack_update_policies,
			),
		"mt_snmp_ver" => array(
			"friendly_name" => "SNMP Version",
			"description" => "Default SNMP version for all new hosts.",
			"method" => "drop_array",
			"default" => "Version 1",
			"array" => $snmp_versions,
			),
		"mt_snmp_community" => array(
			"friendly_name" => "SNMP Community",
			"description" => "Default SNMP read community for all new hosts.",
			"method" => "textbox",
			"default" => "public",
			"max_length" => "100",
			"size" => "20"
			),
		"mt_snmp_communities" => array(
			"friendly_name" => "SNMP Communities",
			"description" => "Fill in the list of available SNMP read strings to test for this device. Each read string must be separated by a colon ':'.  These read strings will be tested sequentially if the primary read string is invalid.",
			"method" => "textbox",
			"default" => "public:private:secret",
			"max_length" => "255"
			),
		"mt_snmp_port" => array(
			"friendly_name" => "SNMP Port",
			"description" => "The UDP/TCP Port to poll the SNMP agent on.",
			"method" => "textbox",
			"default" => "161",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_snmp_timeout" => array(
			"friendly_name" => "SNMP Timeout",
			"description" => "Default SNMP timeout in milli-seconds.",
			"method" => "textbox",
			"default" => "500",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_snmp_retries" => array(
			"friendly_name" => "SNMP Retries",
			"description" => "The number times the SNMP poller will attempt to reach the host before failing.",
			"method" => "textbox",
			"default" => "3",
			"max_length" => "10",
			"size" => "4"
			),
		"mt_interface_exception" => array(
			"friendly_name" => "MacTrack Interface Exception Background Colors",
			"method" => "spacer",
			),
		"mt_int_up_bgc" => array(
			"friendly_name" => "Interface Up",
			"description" => "The background color to use if interface is up.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_up_wo_alias_bgc" => array(
			"friendly_name" => "No ifAlias Background Color",
			"description" => "The background color to use if interface is up without either an ifAlias or PortName.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_errors_bgc" => array(
			"friendly_name" => "Interface with Errors Background Color",
			"description" => "The background color to use if interface has shown errors since the last scan.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_discards_bgc" => array(
			"friendly_name" => "Interface with Discards Background Color",
			"description" => "The background color to use if interface has show discards since the last scan.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_no_graph_bgc" => array(
			"friendly_name" => "Interface Without A Graph",
			"description" => "The background color to use if interface has no graphs.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_no_device_bgc" => array(
			"friendly_name" => "Interface That has no Cacti Device",
			"description" => "The background color to use if device owning this interface is not in Cacti.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_changed_bgc" => array(
			"friendly_name" => "Interface That Has Changed in Less than 24 Hours",
			"description" => "The background color to use if device owning this interface is not in Cacti.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			),
		"mt_int_down_bgc" => array(
			"friendly_name" => "Interface That is Down",
			"description" => "The background color to use if the Interface was down during the last scan.  Select 'None' to hide legend.",
			"method" => "drop_color",
			"default" => 0,
			)
		);

	$settings["visual"]["mactrack_header"] = array(
		"friendly_name" => "Mactrack",
		"method" => "spacer",
		);
	$settings["visual"]["num_rows_mactrack"] = array(
		"friendly_name" => "Rows Per Page",
		"description" => "The number of rows to display on a single page for Device Tracking sites, devices and reports.",
		"method" => "textbox",
		"default" => "30",
		"max_length" => "10"
		);
	$ts = array();
	foreach ($settings['path'] as $t => $ta) {
		$ts[$t] = $ta;
		if ($t == 'path_snmpget') {
			$ts["path_snmpbulkwalk"] = array(
				"friendly_name" => "snmpbulkwalk Binary Path",
				"description" => "The path to your snmpbulkwalk binary.",
				"method" => "textbox",
				"max_length" => "255"
				);
		}
	}
	$settings['path']=$ts;

	mactrack_check_upgrade();
}
Exemple #2
0
function mactrack_config_settings()
{
    global $tabs, $settings, $snmp_versions, $mactrack_poller_frequencies, $mactrack_data_retention, $mactrack_macauth_frequencies, $mactrack_update_policies;
    $tabs['mactrack'] = __('Device Tracking');
    $settings['mactrack'] = array('mactrack_hdr_timing' => array('friendly_name' => __('General Settings'), 'method' => 'spacer'), 'mt_collection_timing' => array('friendly_name' => __('Scanning Frequency'), 'description' => __('Choose when to collect MAC and IP Addresses and Interface statistics from your network devices.'), 'method' => 'drop_array', 'default' => 'disabled', 'array' => $mactrack_poller_frequencies), 'mt_processes' => array('friendly_name' => __('Concurrent Processes'), 'description' => __('Specify how many devices will be polled simultaneously until all devices have been polled.'), 'default' => '7', 'method' => 'textbox', 'max_length' => '10', 'size' => '4'), 'mt_script_runtime' => array('friendly_name' => __('Scanner Max Runtime'), 'description' => __('Specify the number of minutes a device scanning function will allowed to run prior to the system assuming it has been completed.  This setting will correct for abended scanning jobs.'), 'default' => '20', 'method' => 'textbox', 'max_length' => '10', 'size' => '4'), 'mt_base_time' => array('friendly_name' => __('Start Time for Data Collection'), 'description' => __('When would you like the first data collection to take place.  All future data collection times will be based upon this start time.  A good example would be 12:00AM.'), 'default' => '1:00am', 'method' => 'textbox', 'max_length' => '10', 'size' => '8'), 'mt_maint_time' => array('friendly_name' => __('Database Maintenance Time'), 'description' => __('When should old database records be removed from the database.  Please note that no access will be permitted to the port database while this action is taking place.'), 'default' => '12:00am', 'method' => 'textbox', 'max_length' => '10', 'size' => '8'), 'mt_data_retention' => array('friendly_name' => __('Data Retention'), 'description' => __('How long should port MAC details be retained in the database.'), 'method' => 'drop_array', 'default' => '2weeks', 'array' => $mactrack_data_retention), 'mt_ignorePorts_delim' => array('friendly_name' => __('Switch Level Ignore Ports Delimiter'), 'description' => __('What delimiter should MacTrack use when parsing the Ignore Ports string for each switch.'), 'method' => 'drop_array', 'default' => '-1', 'array' => array('-1' => __('Auto Detect'), ':' => __('Colon [:]'), '|' => __('Pipe [|]'), ' ' => __('Space [ ]'))), 'mt_mac_delim' => array('friendly_name' => __('Mac Address Delimiter'), 'description' => __('How should each octet of the MAC address be delimited.'), 'method' => 'drop_array', 'default' => ':', 'array' => array(':' => __('Colon [:]'), '-' => __('Dash [-]'))), 'mt_ignorePorts' => array('method' => 'textbox', 'friendly_name' => __('Ports to Ignore'), 'description' => __('Provide a regular expression of ifNames or ifDescriptions of ports to ignore in the interface list.  For example (Vlan|Loopback|Null).'), 'class' => 'textAreaNotes', 'defaults' => '(Vlan|Loopback|Null)', 'max_length' => '255', 'size' => '80'), 'mt_interface_high' => array('friendly_name' => __('Bandwidth Usage Threshold'), 'description' => __('When reviewing network interface statistics, what bandwidth threshold do you want to view by default.'), 'method' => 'drop_array', 'default' => '70', 'array' => array('-1' => __('N/A'), '10' => __('%d Percent', 10), '20' => __('%d Percent', 20), '30' => __('%d Percent', 30), '40' => __('%d Percent', 40), '50' => __('%d Percent', 50), '60' => __('%d Percent', 60), '70' => __('%d Percent', 70), '80' => __('%d Percent', 80), '90' => __('%d Percent', 90))), 'mt_hdr_rdns' => array('friendly_name' => __('DNS Settings'), 'method' => 'spacer'), 'mt_reverse_dns' => array('friendly_name' => __('Perform Reverse DNS Name Resolution'), 'description' => __('Should MacTrack perform reverse DNS lookup of the IP addresses associated with ports. CAUTION: If DNS is not properly setup, this will slow scan time significantly.'), 'default' => '', 'method' => 'checkbox'), 'mt_dns_primary' => array('friendly_name' => __('Primary DNS IP Address'), 'description' => __('Enter the primary DNS IP Address to utilize for reverse lookups.'), 'method' => 'textbox', 'default' => '', 'max_length' => '30', 'size' => '18'), 'mt_dns_secondary' => array('friendly_name' => __('Secondary DNS IP Address'), 'description' => __('Enter the secondary DNS IP Address to utilize for reverse lookups.'), 'method' => 'textbox', 'default' => '', 'max_length' => '30', 'size' => '18'), 'mt_dns_timeout' => array('friendly_name' => __('DNS Timeout'), 'description' => __('Please enter the DNS timeout in milliseconds.  MacTrack uses a PHP based DNS resolver.'), 'method' => 'textbox', 'default' => '500', 'max_length' => '10', 'size' => '4'), 'mt_dns_prime_interval' => array('friendly_name' => __('DNS Prime Interval'), 'description' => __('How often, in seconds do MacTrack scanning IP\'s need to be resolved to MAC addresses for DNS resolution.  Using a larger number when you have several thousand devices will increase performance.'), 'method' => 'textbox', 'default' => '120', 'max_length' => '10', 'size' => '4'), 'mactrack_hdr_notification' => array('friendly_name' => __('Notification Settings'), 'method' => 'spacer'), 'mt_from_email' => array('friendly_name' => __('Source Address'), 'description' => __('The source e-mail address for MacTrack e-mails.'), 'method' => 'textbox', 'default' => '*****@*****.**', 'max_length' => '100', 'size' => '30'), 'mt_from_name' => array('friendly_name' => __('Source E-Mail Name'), 'description' => __('The Source E-Mail name for MacTrack e-mails.'), 'method' => 'textbox', 'default' => 'MACTrack Administrator', 'max_length' => '100', 'size' => '30'), 'mt_macwatch_description' => array('friendly_name' => __('MacWatch Default Body'), 'description' => htmlspecialchars(__('The e-mail body preset for MacTrack MacWatch e-mails.  The body can contain ' . 'any valid html tags.  It also supports replacement tags that will be processed when sending an e-mail.  ' . 'Valid tags include <IP>, <MAC>, <TICKET>, <SITENAME>, <DEVICEIP>, <PORTNAME>, <PORTNUMBER>, <DEVICENAME>.')), 'method' => 'textarea', 'default' => __('Mac Address <MAC> found at IP Address <IP> for Ticket Number: <TICKET>.<br>The device is located at<br>Site: <SITENAME>, Device <DEVICENAME>, IP <DEVICEIP>, Port <PORTNUMBER>, and Port Name <PORTNAME>'), 'class' => 'textAreaNotes', 'max_length' => '512', 'textarea_rows' => '5', 'textarea_cols' => '80'), 'mt_macauth_emails' => array('friendly_name' => __('MacAuth Report E-Mail Addresses'), 'description' => __('A comma delimited list of users to recieve the MacAuth e-mail notifications.'), 'method' => 'textarea', 'default' => '', 'class' => 'textAreaNotes', 'max_length' => '255', 'textarea_rows' => '5', 'textarea_cols' => '80'), 'mt_macauth_email_frequency' => array('friendly_name' => __('MacAuth Report Frequency'), 'description' => __('How often will the MacAuth Reports be e-mailed.'), 'method' => 'drop_array', 'default' => 'disabled', 'array' => $mactrack_macauth_frequencies), 'mactrack_hdr_arpwatch' => array('friendly_name' => __('MacTrack Arpwatch Settings'), 'method' => 'spacer'), 'mt_arpwatch' => array('friendly_name' => __('Enable ArpWatch'), 'description' => __('Should MacTrack also use ArpWatch data to supplement Mac to IP/DNS resolution?'), 'default' => '', 'method' => 'checkbox'), 'mt_arpwatch_path' => array('friendly_name' => __('ArpWatch Database Path'), 'description' => __('The location of the ArpWatch Database file on the Cacti server.'), 'method' => 'filepath', 'default' => '', 'max_length' => '255', 'size' => '60'), 'mactrack_hdr_general' => array('friendly_name' => __('SNMP Presets'), 'method' => 'spacer'), 'mt_update_policy' => array('friendly_name' => __('Update Policy for SNMP Options'), 'description' => __('Policy for synchronization of SNMP Options between Cacti devices and Mactrack Devices.'), 'method' => 'drop_array', 'default' => 1, 'array' => $mactrack_update_policies), 'mt_snmp_ver' => array('friendly_name' => __('Version'), 'description' => __('Default SNMP version for all new hosts.'), 'method' => 'drop_array', 'default' => '2', 'array' => $snmp_versions), 'mt_snmp_community' => array('friendly_name' => __('Community'), 'description' => __('Default SNMP read community for all new hosts.'), 'method' => 'textbox', 'default' => 'public', 'max_length' => '100', 'size' => '20'), 'mt_snmp_communities' => array('friendly_name' => __('Communities'), 'description' => __('Fill in the list of available SNMP read strings to test for this device. Each read string must be separated by a colon \':\'.  These read strings will be tested sequentially if the primary read string is invalid.'), 'method' => 'textbox', 'default' => 'public:private:secret', 'max_length' => '255'), 'mt_snmp_port' => array('friendly_name' => __('Port'), 'description' => __('The UDP/TCP Port to poll the SNMP agent on.'), 'method' => 'textbox', 'default' => '161', 'max_length' => '10', 'size' => '4'), 'mt_snmp_timeout' => array('friendly_name' => __('Timeout'), 'description' => __('Default SNMP timeout in milli-seconds.'), 'method' => 'textbox', 'default' => '500', 'max_length' => '10', 'size' => '4'), 'mt_snmp_retries' => array('friendly_name' => __('Retries'), 'description' => __('The number times the SNMP poller will attempt to reach the host before failing.'), 'method' => 'textbox', 'default' => '3', 'max_length' => '10', 'size' => '4'));
    $ts = array();
    foreach ($settings['path'] as $t => $ta) {
        $ts[$t] = $ta;
        if ($t == 'path_snmpget') {
            $ts['path_snmpbulkwalk'] = array('friendly_name' => __('snmpbulkwalk Binary Path'), 'description' => __('The path to your snmpbulkwalk binary.'), 'method' => 'textbox', 'max_length' => '255');
        }
    }
    $settings['path'] = $ts;
    mactrack_check_upgrade();
}