Pretty up the polling process output

This commit is contained in:
laf
2016-06-21 01:41:45 +01:00
parent 558dfb2344
commit a194009917
19 changed files with 14 additions and 31 deletions

View File

@@ -237,7 +237,6 @@ function RunGroupMacros($rule,$x=1) {
function UpdateGroupsForDevice($device_id)
{
global $debug;
$debug = true;
$queried_groups = QueryGroupsFromDevice($device_id);
$db_groups = GetGroupsFromDevice($device_id);

View File

@@ -6,7 +6,6 @@ d_echo($sql."\n");
$app_rows = dbFetchRows('SELECT * FROM `applications` WHERE `device_id` = ?', array($device['device_id']));
if (count($app_rows)) {
echo 'Applications:';
foreach ($app_rows as $app) {
$app_include = $config['install_dir'].'/includes/polling/applications/'.$app['app_type'].'.inc.php';
if (is_file($app_include)) {

View File

@@ -2,7 +2,6 @@
if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') {
global $config;
echo 'Aruba Controller: ';
$polled = time();
// Build SNMP Cache Array

View File

@@ -64,9 +64,8 @@ if ($device['os_group'] == "cisco") {
}
} // End foreach components
echo $module." ";
} // end if count components
// Clean-up after yourself!
unset($type, $components, $component, $options, $module);
}
}

View File

@@ -1,7 +1,6 @@
<?php
if ($device['os_group'] == 'cisco') {
echo 'Cisco CEF Switching Path: ';
$cefs = array();
$cefs = snmpwalk_cache_threepart_oid($device, 'CISCO-CEF-MIB::cefSwitchingStatsEntry', $cefs, 'CISCO-CEF-MIB');

View File

@@ -6,7 +6,6 @@ if ($device['os_group'] == 'cisco') {
'cipMacHCSwitchedBytes',
'cipMacHCSwitchedPkts',
);
echo 'Cisco MAC - Caching OID: ';
$cip_array = array();
foreach ($cip_oids as $oid) {

View File

@@ -198,9 +198,8 @@ if ($device['os_group'] == "cisco") {
// Write the Components back to the DB.
$component->setComponentPrefs($device['device_id'],$components);
echo $module." ";
} // end if count components
// Clean-up after yourself!
unset($components, $component, $module);
}
}

View File

@@ -65,7 +65,6 @@ if ($device['os_group'] == 'cisco') {
influx_update($device,'cras_sessions',$tags,$fields);
$graphs['cras_sessions'] = true;
echo ' CRAS Sessions';
}
unset($data, $$rrd_filename, $rrd_create, $fields);

View File

@@ -1,7 +1,5 @@
<?php
echo 'Entity Physical: ';
if ($device['os'] == 'ios') {
echo "Cisco Cat6xxx/76xx Crossbar : \n";

View File

@@ -237,17 +237,14 @@ function poll_device($device, $options) {
if ($options['m']) {
foreach (explode(',', $options['m']) as $module) {
if (is_file('includes/polling/'.$module.'.inc.php')) {
include 'includes/polling/'.$module.'.inc.php';
load_poller_module($module, $device, $attribs);
}
}
}
else {
foreach ($config['poller_modules'] as $module => $module_status) {
if ($attribs['poll_'.$module] || ( $module_status && !isset($attribs['poll_'.$module]))) {
$module_start = microtime(true);
include 'includes/polling/'.$module.'.inc.php';
$module_time = microtime(true) - $module_start;
echo "Runtime for polling module '$module': $module_time\n";
load_poller_module($module, $device, $attribs);
// save per-module poller stats
$tags = array(
@@ -530,3 +527,13 @@ function location_to_latlng($device) {
}
}
}// end location_to_latlng()
function load_poller_module($module, $device) {
global $config, $valid;
$module_start = microtime(true);
echo "\n#### Load poller module $module ####\n";
include "includes/polling/$module.inc.php";
$module_time = microtime(true) - $module_start;
echo "\n>> Runtime for poller module '$module': $module_time\n";
echo "#### Unload poller module $module ####\n\n";
}

View File

@@ -5,8 +5,6 @@
$oid_list = 'hrSystemProcesses.0 hrSystemNumUsers.0';
$hrSystem = snmp_get_multi($device, $oid_list, '-OUQs', 'HOST-RESOURCES-MIB');
echo 'HR Stats:';
if (is_numeric($hrSystem[0]['hrSystemProcesses'])) {
$rrd_file = $config['rrd_dir'].'/'.$device['hostname'].'/hr_processes.rrd';
if (!is_file($rrd_file)) {

View File

@@ -46,7 +46,6 @@
// IP-MIB::ipSystemStatsDiscontinuityTime.ipv6 = Timeticks: (0) 0:00:00.00
// IP-MIB::ipSystemStatsRefreshRate.ipv4 = Gauge32: 30000 milli-seconds
// IP-MIB::ipSystemStatsRefreshRate.ipv6 = Gauge32: 30000 milli-seconds
echo 'Polling IP-MIB ipSystemStats ';
$ipSystemStats = snmpwalk_cache_oid($device, 'ipSystemStats', null, 'IP-MIB');

View File

@@ -13,8 +13,6 @@ if (count($vp_rows)) {
$vp_cache = snmpwalk_cache_multi_oid($device, 'juniAtmVpStatsOutPacketOctets', $vp_cache, 'Juniper-UNI-ATM-MIB', $config['install_dir'].'/mibs/junose');
$vp_cache = snmpwalk_cache_multi_oid($device, 'juniAtmVpStatsOutPacketErrors', $vp_cache, 'Juniper-UNI-ATM-MIB', $config['install_dir'].'/mibs/junose');
echo 'Checking JunOSe ATM vps: ';
foreach ($vp_rows as $vp) {
echo '.';

View File

@@ -31,7 +31,6 @@
// NS-ROOT-MIB::vsvrTotalClients."observium" = Counter64: 43023
// NS-ROOT-MIB::vsvrClientConnOpenRate."observium" = STRING: "0"
if ($device['os'] == 'netscaler') {
echo "Netscaler VServers\n";
$oids_gauge = array(
'vsvrCurClntConnections',

View File

@@ -1,7 +1,5 @@
<?php
echo 'Polling Netstats:';
require 'netstats-ip.inc.php';
require 'netstats-tcp.inc.php';
require 'netstats-udp.inc.php';

View File

@@ -1,6 +1,5 @@
<?php
echo 'OSPF: ';
$ospf_instance_count = 0;
$ospf_port_count = 0;
$ospf_area_count = 0;

View File

@@ -14,8 +14,6 @@
* needs RSTP-MIB
*/
echo "Spanning Tree: ";
// Pre-cache existing state of STP for this device from database
$stp_db = dbFetchRow('SELECT * FROM `stp` WHERE `device_id` = ?', array($device['device_id']));
//d_echo($stp_db);

View File

@@ -6,8 +6,6 @@ if (count($diskio_data)) {
$diskio_cache = array();
$diskio_cache = snmpwalk_cache_oid($device, 'diskIOEntry', $diskio_cache, 'UCD-DISKIO-MIB');
echo 'Checking UCD DiskIO MIB: ';
foreach ($diskio_data as $diskio) {
$index = $diskio['diskio_index'];

View File

@@ -1,7 +1,6 @@
<?php
if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['type'] == 'wireless') {
echo "Wireless: MAG\n";
if ($device['os'] == 'airos') {
echo "It Is Airos\n";