예제 #1
0
function process_port_etherlike(&$this_port, $device)
{
    // Used to loop below for StatsD
    $etherlike_oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames', 'dot3StatsSQETestErrors', 'dot3StatsDeferredTransmissions', 'dot3StatsLateCollisions', 'dot3StatsExcessiveCollisions', 'dot3StatsInternalMacTransmitErrors', 'dot3StatsCarrierSenseErrors', 'dot3StatsFrameTooLongs', 'dot3StatsInternalMacReceiveErrors', 'dot3StatsSymbolErrors');
    // Overwrite ifDuplex with dot3StatsDuplexStatus if it exists
    if (isset($this_port['dot3StatsDuplexStatus'])) {
        // echo("dot3Duplex, ");
        $this_port['ifDuplex'] = $this_port['dot3StatsDuplexStatus'];
    }
    if ($this_port['ifType'] == "ethernetCsmacd" && isset($this_port['dot3StatsIndex'])) {
        // Check to make sure Port data is cached.
        rrdtool_update_ng($device, 'port-dot3', array('dot3StatsAlignmentErrors' => $this_port['dot3StatsAlignmentErrors'], 'dot3StatsFCSErrors' => $this_port['dot3StatsFCSErrors'], 'dot3StatsSingleCollisionFrames' => $this_port['dot3StatsSingleCollisionFrames'], 'dot3StatsMultipleCollisionFrames' => $this_port['dot3StatsMultipleCollisionFrames'], 'dot3StatsSQETestErrors' => $this_port['dot3StatsSQETestErrors'], 'dot3StatsDeferredTransmissions' => $this_port['dot3StatsDeferredTransmissions'], 'dot3StatsLateCollisions' => $this_port['dot3StatsLateCollisions'], 'dot3StatsExcessiveCollisions' => $this_port['dot3StatsExcessiveCollisions'], 'dot3StatsInternalMacTransmitErrors' => $this_port['dot3StatsInternalMacTransmitErrors'], 'dot3StatsCarrierSenseErrors' => $this_port['dot3StatsCarrierSenseErrors'], 'dot3StatsFrameTooLongs' => $this_port['dot3StatsFrameTooLongs'], 'dot3StatsInternalMacReceiveErrors' => $this_port['dot3StatsInternalMacReceiveErrors'], 'dot3StatsSymbolErrors' => $this_port['dot3StatsSymbolErrors']), get_port_rrdindex($this_port));
        if ($GLOBALS['config']['statsd']['enable'] == TRUE) {
            foreach ($etherlike_oids as $oid) {
                // Update StatsD/Carbon
                StatsD::gauge(str_replace(".", "_", $device['hostname']) . '.' . 'port' . '.' . $this_port['ifIndex'] . '.' . $oid, $this_port[$oid]);
            }
        }
    }
}
예제 #2
0
function process_port_adsl(&$this_port, $device, $port)
{
    // Check to make sure Port data is cached.
    if (!isset($this_port['adslLineCoding'])) {
        return;
    }
    // Used below for StatsD only
    $adsl_oids = array('adslAtucCurrSnrMgn', 'adslAtucCurrAtn', 'adslAtucCurrOutputPwr', 'adslAtucCurrAttainableRate', 'adslAtucChanCurrTxRate', 'adslAturCurrSnrMgn', 'adslAturCurrAtn', 'adslAturCurrOutputPwr', 'adslAturCurrAttainableRate', 'adslAturChanCurrTxRate', 'adslAtucPerfLofs', 'adslAtucPerfLoss', 'adslAtucPerfLprs', 'adslAtucPerfESs', 'adslAtucPerfInits', 'adslAturPerfLofs', 'adslAturPerfLoss', 'adslAturPerfLprs', 'adslAturPerfESs', 'adslAtucChanCorrectedBlks', 'adslAtucChanUncorrectBlks', 'adslAturChanCorrectedBlks', 'adslAturChanUncorrectBlks');
    $adsl_db_oids = array('adslLineCoding', 'adslLineType', 'adslAtucInvVendorID', 'adslAtucInvVersionNumber', 'adslAtucCurrSnrMgn', 'adslAtucCurrAtn', 'adslAtucCurrOutputPwr', 'adslAtucCurrAttainableRate', 'adslAturInvSerialNumber', 'adslAturInvVendorID', 'adslAturInvVersionNumber', 'adslAtucChanCurrTxRate', 'adslAturChanCurrTxRate', 'adslAturCurrSnrMgn', 'adslAturCurrAtn', 'adslAturCurrOutputPwr', 'adslAturCurrAttainableRate');
    $adsl_tenth_oids = array('adslAtucCurrSnrMgn', 'adslAtucCurrAtn', 'adslAtucCurrOutputPwr', 'adslAturCurrSnrMgn', 'adslAturCurrAtn', 'adslAturCurrOutputPwr');
    foreach ($adsl_tenth_oids as $oid) {
        if (isset($this_port[$oid])) {
            $this_port[$oid] = $this_port[$oid] / 10;
        }
    }
    if (dbFetchCell("SELECT COUNT(*) FROM `ports_adsl` WHERE `port_id` = ?", array($port['port_id'])) == "0") {
        dbInsert(array('port_id' => $port['port_id']), 'ports_adsl');
    }
    $adsl_update = array('port_adsl_updated' => array('NOW()'));
    foreach ($adsl_db_oids as $oid) {
        $adsl_update[$oid] = $this_port[$oid];
    }
    dbUpdate($adsl_update, 'ports_adsl', '`port_id` = ?', array($port['port_id']));
    if ($this_port['adslAtucCurrSnrMgn'] > "1280") {
        $this_port['adslAtucCurrSnrMgn'] = "U";
    }
    if ($this_port['adslAturCurrSnrMgn'] > "1280") {
        $this_port['adslAturCurrSnrMgn'] = "U";
    }
    rrdtool_update_ng($device, 'port-adsl', array('AtucCurrSnrMgn' => $this_port['adslAtucCurrSnrMgn'], 'AtucCurrAtn' => $this_port['adslAtucCurrAtn'], 'AtucCurrOutputPwr' => $this_port['adslAtucCurrOutputPwr'], 'AtucCurrAttainableR' => $this_port['adslAtucCurrAttainableR'], 'AtucChanCurrTxRate' => $this_port['adslAtucChanCurrTxRate'], 'AturCurrSnrMgn' => $this_port['adslAturCurrSnrMgn'], 'AturCurrAtn' => $this_port['adslAturCurrAtn'], 'AturCurrOutputPwr' => $this_port['adslAturCurrOutputPwr'], 'AturCurrAttainableR' => $this_port['adslAturCurrAttainableR'], 'AturChanCurrTxRate' => $this_port['adslAturChanCurrTxRate'], 'AtucPerfLofs' => $this_port['adslAtucPerfLofs'], 'AtucPerfLoss' => $this_port['adslAtucPerfLoss'], 'AtucPerfLprs' => $this_port['adslAtucPerfLprs'], 'AtucPerfESs' => $this_port['adslAtucPerfESs'], 'AtucPerfInits' => $this_port['adslAtucPerfInits'], 'AturPerfLofs' => $this_port['adslAturPerfLofs'], 'AturPerfLoss' => $this_port['adslAturPerfLoss'], 'AturPerfLprs' => $this_port['adslAturPerfLprs'], 'AturPerfESs' => $this_port['adslAturPerfESs'], 'AtucChanCorrectedBl' => $this_port['adslAtucChanCorrectedBl'], 'AtucChanUncorrectBl' => $this_port['adslAtucChanUncorrectBl'], 'AturChanCorrectedBl' => $this_port['adslAturChanCorrectedBl'], 'AturChanUncorrectBl' => $this_port['adslAturChanUncorrectBl']), get_port_rrdindex($port));
    if ($GLOBALS['config']['statsd']['enable']) {
        foreach ($adsl_oids as $oid) {
            // Update StatsD/Carbon
            StatsD::gauge(str_replace(".", "_", $device['hostname']) . '.' . 'port' . '.' . $port['ifIndex'] . '.' . $oid, $this_port[$oid]);
        }
    }
    //echo("ADSL (".$this_port['adslLineCoding']."/".formatRates($this_port['adslAtucChanCurrTxRate'])."/".formatRates($this_port['adslAturChanCurrTxRate']).")");
}
예제 #3
0
 $port['alert_array']['rx_ave_pktsize'] = $port['state']['ifInOctets_delta'] / ($port['state']['ifInUcastPkts_delta'] + $port['state']['ifInNUcastPkts_delta']);
 $port['alert_array']['tx_ave_pktsize'] = $port['state']['ifOutOctets_delta'] / ($port['state']['ifOutUcastPkts_delta'] + $port['state']['ifOutNUcastPkts_delta']);
 // Store aggregate in/out state
 $port['state']['ifOctets_rate'] = $port['stats']['ifOutOctets_rate'] + $port['stats']['ifInOctets_rate'];
 $port['state']['ifUcastPkts_rate'] = $port['stats']['ifOutUcastPkts_rate'] + $port['stats']['ifInUcastPkts_rate'];
 $port['state']['ifErrors_rate'] = $port['stats']['ifOutErrors_rate'] + $port['stats']['ifInErrors_rate'];
 // Send aggregate data to alerter too
 $port['alert_array']['ifOctets_rate'] = $port['state']['ifOctets_rate'];
 $port['alert_array']['ifUcastPkts_rate'] = $port['state']['ifUcastPkts_rate'];
 $port['alert_array']['ifNUcastPkts_rate'] = $port['stats']['ifOutNUcastPkts_rate'] + $port['stats']['ifInNUcastPkts_rate'];
 $port['alert_array']['ifErrors_rate'] = $port['state']['ifErrors_rate'];
 $port['alert_array']['ifBroadcastPkts_rate'] = $port['stats']['ifOutBroadcastPkts_rate'] + $port['stats']['ifInBroadcastPkts_rate'];
 $port['alert_array']['ifMulticastPkts_rate'] = $port['stats']['ifOutMulticastPkts_rate'] + $port['stats']['ifInMulticastPkts_rate'];
 $port['alert_array']['ifDiscards_rate'] = $port['stats']['ifOutDiscards_rate'] + $port['stats']['ifInDiscards_rate'];
 // Update RRDs
 rrdtool_update_ng($device, 'port', array('INOCTETS' => $this_port['ifInOctets'], 'OUTOCTETS' => $this_port['ifOutOctets'], 'INERRORS' => $this_port['ifInErrors'], 'OUTERRORS' => $this_port['ifOutErrors'], 'INUCASTPKTS' => $this_port['ifInUcastPkts'], 'OUTUCASTPKTS' => $this_port['ifOutUcastPkts'], 'INNUCASTPKTS' => $this_port['ifInNUcastPkts'], 'OUTNUCASTPKTS' => $this_port['ifOutNUcastPkts'], 'INDISCARDS' => $this_port['ifInDiscards'], 'OUTDISCARDS' => $this_port['ifOutDiscards'], 'INUNKNOWNPROTOS' => $this_port['ifInUnknownProtos'], 'INBROADCASTPKTS' => $this_port['ifInBroadcastPkts'], 'OUTBROADCASTPKTS' => $this_port['ifOutBroadcastPkts'], 'INMULTICASTPKTS' => $this_port['ifInMulticastPkts'], 'OUTMULTICASTPKTS' => $this_port['ifOutMulticastPkts']), get_port_rrdindex($port));
 // End Update IF-MIB
 // Update additional MIBS and modules
 foreach ($process_port_db as $port_module => $oids) {
     $log_event = array();
     foreach ($oids as $oid) {
         if ($port[$oid] != $this_port[$oid]) {
             if (isset($this_port[$oid])) {
                 $port['update'][$oid] = $this_port[$oid];
                 $msg = "[{$oid}] '" . $port[$oid] . "' -> '" . $this_port[$oid] . "'";
             } else {
                 $port['update'][$oid] = array('NULL');
                 $msg = "[{$oid}] '" . $port[$oid] . "' -> NULL";
             }
             $log_event[] = $msg;
             if (OBS_DEBUG) {
예제 #4
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['postfix_qshape'])) {
    $app_id = discover_app($device, 'postfix_qshape');
    foreach (explode("\n", $agent_data['app']['postfix_qshape']) as $line) {
        list($item, $value) = explode(":", $line, 2);
        $queue_data[trim($item)] = trim($value);
    }
    rrdtool_update_ng($device, 'postfix-qshape', $queue_data);
    update_application($app_id, $queue_data);
    unset($queue_data, $item, $value);
}
// EOF
예제 #5
0
             $peer['c_update']['SuppressedPrefixes'] = $cbgpPeerSuppressedPrefixes;
             $peer['c_update']['WithdrawnPrefixes'] = $cbgpPeerWithdrawnPrefixes;
             if (dbFetchCell('SELECT COUNT(`cbgp_id`) FROM `bgpPeers_cbgp-state` WHERE `cbgp_id` = ?', array($peer_afi['cbgp_id'])) == 0) {
                 dbInsert(array('cbgp_id' => $peer_afi['cbgp_id']), 'bgpPeers_cbgp-state');
             }
             dbUpdate($peer['c_update'], 'bgpPeers_cbgp-state', '`cbgp_id` = ?', array($peer_afi['cbgp_id']));
             // Update cbgp StatsD
             if ($config['statsd']['enable'] == TRUE) {
                 foreach (array('AcceptedPrefixes', 'DeniedPrefixes', 'AdvertisedPrefixes', 'SuppressedPrefixes', 'WithdrawnPrefixes') as $oid) {
                     // Update StatsD/Carbon
                     $r_oid = 'cbgpPeer' . $oid;
                     StatsD::gauge(str_replace('.', '_', $device['hostname']) . '.' . 'bgp' . '.' . str_replace('.', '_', $peer_ip) . ".{$afi}.{$safi}" . '.' . $oid, ${$r_oid});
                 }
             }
             // Update RRD
             rrdtool_update_ng($device, 'cbgp', array('AcceptedPrefixes' => $cbgpPeerAcceptedPrefixes, 'DeniedPrefixes' => $cbgpPeerDeniedPrefixes, 'AdvertisedPrefixes' => $cbgpPeerAdvertisedPrefixes, 'SuppressedPrefixes' => $cbgpPeerSuppressedPrefixes, 'WithdrawnPrefixes' => $cbgpPeerWithdrawnPrefixes), $peer_ip . ".{$afi}.{$safi}");
             $graphs['bgp_prefixes_' . $afi . $safi] = TRUE;
             $c_table_row = array();
             $c_table_row[] = $peer_ip;
             $c_table_row[] = $peer['bgpPeerRemoteAs'];
             $c_table_row[] = $afi . "-" . $safi;
             $c_table_row[] = $cbgpPeerAcceptedPrefixes;
             $c_table_row[] = $cbgpPeerDeniedPrefixes;
             $c_table_row[] = $cbgpPeerAdvertisedPrefixes;
             $c_table_rows[] = $c_table_row;
             unset($c_table_row);
         }
         # while
     }
     # os_group=cisco | vendors
 }
예제 #6
0
/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (is_array($agent_data['app']['openvpn'])) {
    foreach ($agent_data['app']['openvpn'] as $key => $entry) {
        if (substr($key, 0, 9) == 'loadstats') {
            list(, $instance) = explode('-', $key, 2);
            $loadstats[$instance] = array();
            # SUCCESS: nclients=1,bytesin=484758,bytesout=180629
            foreach (explode(',', str_replace('SUCCESS: ', '', $entry)) as $keyvalue) {
                list($key, $value) = explode('=', $keyvalue, 2);
                $loadstats[$instance][$key] = $value;
            }
        }
    }
}
foreach ($loadstats as $instance => $data) {
    $app_id = discover_app($device, 'openvpn', $instance);
    update_application($app_id, $data);
    rrdtool_update_ng($device, 'openvpn', $data, $instance);
}
unset($loadstats);
// EOF
예제 #7
0
                 } else {
                     // Hrrmm.. it looks like empty snmp walk
                     continue;
                 }
             }
         }
     }
 }
 $mempool['free'] = $mempool['total'] - $mempool['used'];
 $hc = $mempool['mempool_hc'] ? ' (HC)' : '';
 // Update StatsD/Carbon
 if ($config['statsd']['enable'] == TRUE) {
     StatsD::gauge(str_replace(".", "_", $device['hostname']) . '.' . 'mempool' . '.' . $mempool['mempool_mib'] . "." . $mempool['mempool_index'] . ".used", $mempool['used']);
     StatsD::gauge(str_replace(".", "_", $device['hostname']) . '.' . 'mempool' . '.' . $mempool['mempool_mib'] . "." . $mempool['mempool_index'] . ".free", $mempool['free']);
 }
 rrdtool_update_ng($device, 'mempool', array('used' => $mempool['used'], 'free' => $mempool['free']), $mempool['mempool_mib'] . "-" . $mempool['mempool_index']);
 if (!is_numeric($mempool['mempool_polled'])) {
     dbInsert(array('mempool_id' => $mempool['mempool_id']), 'mempools-state');
 }
 $mempool['state'] = array('mempool_polled' => time(), 'mempool_used' => $mempool['used'], 'mempool_perc' => $mempool['perc'], 'mempool_free' => $mempool['free'], 'mempool_total' => $mempool['total']);
 dbUpdate($mempool['state'], 'mempools-state', '`mempool_id` = ?', array($mempool['mempool_id']));
 $graphs['mempool'] = TRUE;
 check_entity('mempool', $mempool, array('mempool_perc' => $mempool['perc'], 'mempool_free' => $mempool['free'], 'mempool_used' => $mempool['used']));
 //  print_message("Mempool ". $mempool['mempool_descr'] . ': '.$mempool['perc'].'%%'.$hc);
 $table_row = array();
 $table_row[] = $mempool['mempool_descr'];
 $table_row[] = $mempool['mempool_mib'];
 $table_row[] = $mempool['mempool_index'];
 $table_row[] = formatStorage($mempool['total']);
 $table_row[] = formatStorage($mempool['used']);
 $table_row[] = formatStorage($mempool['free']);
예제 #8
0
function poll_p2p_radio($device, $mib, $index, $radio)
{
    $params = array('radio_tx_freq', 'radio_rx_freq', 'radio_tx_power', 'radio_rx_level', 'radio_name', 'radio_bandwidth', 'radio_modulation', 'radio_total_capacity', 'radio_standard', 'radio_loopback', 'radio_tx_mute', 'radio_eth_capacity', 'radio_e1t1_channels', 'radio_cur_capacity');
    if (is_array($GLOBALS['cache']['p2p_radios'][$mib][$index])) {
        $radio_db = $GLOBALS['cache']['p2p_radios'][$mib][$index];
    }
    // Update the Database
    if (!isset($radio_db['radio_id'])) {
        $insert = array();
        $insert['device_id'] = $device['device_id'];
        $insert['radio_mib'] = $mib;
        $insert['radio_index'] = $index;
        foreach ($params as $param) {
            $insert[$param] = $radio[$param];
            if ($radio[$param] == NULL) {
                $insert[$param] = array('NULL');
            }
        }
        $radio_id = dbInsert($insert, 'p2p_radios');
        echo "+";
    } else {
        // If we already have an entry, check if it needs updating
        $update = array();
        foreach ($params as $param) {
            if ($radio[$param] != $radio_db[$param]) {
                $update[$param] = $radio[$param];
            }
        }
        if (count($update)) {
            dbUpdate($update, 'p2p_radios', '`radio_id` = ?', array($radio_db['radio_id']));
            echo 'U';
        } else {
            echo '.';
        }
    }
    rrdtool_update_ng($device, 'p2p_radio', array('tx_power' => $radio['radio_tx_power'], 'rx_level' => $radio['radio_rx_level'], 'rmse' => $radio['radio_rmse'], 'agc_gain' => $radio['radio_agc_gain'], 'cur_capacity' => $radio['radio_cur_capacity'], 'sym_rate_tx' => $radio['radio_sym_rate_tx'], 'sym_rate_rx' => $radio['radio_sym_rate_tx']), "{$mib}-{$index}");
    $GLOBALS['valid']['p2p_radio'][$mib][$index] = 1;
    // FIXME. What? How it passed there?
}
예제 #9
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['ntpd'])) {
    $app_id = discover_app($device, 'ntpd');
    foreach (explode("\n", $agent_data['app']['ntpd']) as $line) {
        list($item, $value) = explode(":", $line, 2);
        $ntpd_data[trim($item)] = trim($value);
    }
    $ntpd_type = isset($ntpd_data['server']) ? "server" : "client";
    switch ($ntpd_type) {
        case 'server':
            rrdtool_update_ng($device, 'ntpd-server', $ntpd_data, $app_id);
            break;
        case 'client':
            rrdtool_update_ng($device, 'ntpd-client', $ntpd_data, $app_id);
            break;
    }
    update_application($app_id, $ntpd_data);
    unset($ntpd_type, $app_id, $ntpd_data);
}
// EOF
예제 #10
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['powerdns'])) {
    $app_id = discover_app($device, 'powerdns');
    foreach (explode(",", $agent_data['app']['powerdns']) as $line) {
        list($key, $value) = explode("=", $line, 2);
        $powerdns[$key] = $value;
    }
    $data = array('corruptPackets' => $powerdns['corrupt-packets'], 'def_cacheInserts' => $powerdns['deferred-cache-inserts'], 'def_cacheLookup' => $powerdns['deferred-cache-lookup'], 'latency' => $powerdns['latency'], 'pc_hit' => $powerdns['packetcache-hit'], 'pc_miss' => $powerdns['packetcache-miss'], 'pc_size' => $powerdns['packetcache-size'], 'qsize' => $powerdns['qsize-q'], 'qc_hit' => $powerdns['query-cache-hit'], 'qc_miss' => $powerdns['query-cache-miss'], 'rec_answers' => $powerdns['recursing-answers'], 'rec_questions' => $powerdns['recursing-questions'], 'servfailPackets' => $powerdns['servfail-packets'], 'q_tcpAnswers' => $powerdns['tcp-answers'], 'q_tcpQueries' => $powerdns['tcp-queries'], 'q_timedout' => $powerdns['timedout-packets'], 'q_udpAnswers' => $powerdns['udp-answers'], 'q_udpQueries' => $powerdns['udp-queries'], 'q_udp4Answers' => $powerdns['udp4-answers'], 'q_udp4Queries' => $powerdns['udp4-queries'], 'q_udp6Answers' => $powerdns['udp6-answers'], 'q_udp6Queries' => $powerdns['udp6-queries']);
    update_application($app_id, $data);
    rrdtool_update_ng($device, 'powerdns', $data, $app_id);
    unset($powerdns);
}
// EOF
예제 #11
0
                 default:
                     $zimbra['mailboxd-total'][$key] = $zimbra['mailboxd'][$line][$key];
                     break;
             }
         }
     }
     rrdtool_update_ng($device, 'zimbra-mailboxd', array('lmtpRcvdMsgs' => $zimbra['mailboxd-total']['lmtp_rcvd_msgs'], 'lmtpRcvdBytes' => $zimbra['mailboxd-total']['lmtp_rcvd_bytes'], 'lmtpRcvdRcpt' => $zimbra['mailboxd-total']['lmtp_rcvd_rcpt'], 'lmtpDlvdMsgs' => $zimbra['mailboxd-total']['lmtp_dlvd_msgs'], 'lmtpDlvdBytes' => $zimbra['mailboxd-total']['lmtp_dlvd_bytes'], 'dbConnCount' => $zimbra['mailboxd-total']['db_conn_count'], 'dbConnMsAvg' => $zimbra['mailboxd-total']['db_conn_ms_avg'], 'ldapDcCount' => $zimbra['mailboxd-total']['ldap_dc_count'], 'ldapDcMsAvg' => $zimbra['mailboxd-total']['ldap_dc_ms_avg'], 'mboxAddMsgCount' => $zimbra['mailboxd-total']['mbox_add_msg_count'], 'mboxAddMsgMsAvg' => $zimbra['mailboxd-total']['mbox_add_msg_ms_avg'], 'mboxGetCount' => $zimbra['mailboxd-total']['mbox_get_count'], 'mboxGetMsAvg' => $zimbra['mailboxd-total']['mbox_get_ms_avg'], 'mboxCache' => $zimbra['mailboxd-total']['mbox_cache'], 'mboxMsgCache' => $zimbra['mailboxd-total']['mbox_msg_cache'], 'mboxItemCache' => $zimbra['mailboxd-total']['mbox_item_cache'], 'soapCount' => $zimbra['mailboxd-total']['soap_count'], 'soapMsAvg' => $zimbra['mailboxd-total']['soap_ms_avg'], 'imapCount' => $zimbra['mailboxd-total']['imap_count'], 'imapMsAvg' => $zimbra['mailboxd-total']['imap_ms_avg'], 'popCount' => $zimbra['mailboxd-total']['pop_count'], 'popMsAvg' => $zimbra['mailboxd-total']['pop_ms_avg'], 'idxWrtAvg' => $zimbra['mailboxd-total']['idx_wrt_avg'], 'idxWrtOpened' => $zimbra['mailboxd-total']['idx_wrt_opened'], 'idxWrtOpenedCacheHt' => $zimbra['mailboxd-total']['idx_wrt_opened_cache_hit'], 'calcacheHit' => $zimbra['mailboxd-total']['calcache_hit'], 'calcacheMemHit' => $zimbra['mailboxd-total']['calcache_mem_hit'], 'calcacheLruSize' => $zimbra['mailboxd-total']['calcache_lru_size'], 'idxBytesWritten' => $zimbra['mailboxd-total']['idx_bytes_written'], 'idxBytesWrittenAvg' => $zimbra['mailboxd-total']['idx_bytes_written_avg'], 'idxBytesRead' => $zimbra['mailboxd-total']['idx_bytes_read'], 'idxBytesReadAvg' => $zimbra['mailboxd-total']['idx_bytes_read_avg'], 'bisRead' => $zimbra['mailboxd-total']['bis_read'], 'bisSeekRate' => $zimbra['mailboxd-total']['bis_seek_rate'], 'dbPoolSize' => $zimbra['mailboxd-total']['db_pool_size'], 'innodbBpHitRate' => $zimbra['mailboxd-total']['innodb_bp_hit_rate'], 'lmtpConn' => $zimbra['mailboxd-total']['lmtp_conn'], 'lmtpThreads' => $zimbra['mailboxd-total']['lmtp_threads'], 'popConn' => $zimbra['mailboxd-total']['pop_conn'], 'popThreads' => $zimbra['mailboxd-total']['pop_threads'], 'popSslConn' => $zimbra['mailboxd-total']['pop_ssl_conn'], 'popSslThreads' => $zimbra['mailboxd-total']['pop_ssl_threads'], 'imapConn' => $zimbra['mailboxd-total']['imap_conn'], 'imapThreads' => $zimbra['mailboxd-total']['imap_threads'], 'imapSslConn' => $zimbra['mailboxd-total']['imap_ssl_conn'], 'imapSslThreads' => $zimbra['mailboxd-total']['imap_ssl_threads'], 'httpIdleThreads' => $zimbra['mailboxd-total']['http_idle_threads'], 'httpThreads' => $zimbra['mailboxd-total']['http_threads'], 'soapSessions' => $zimbra['mailboxd-total']['soap_sessions'], 'mboxCacheSize' => $zimbra['mailboxd-total']['mbox_cache_size'], 'msgCacheSize' => $zimbra['mailboxd-total']['msg_cache_size'], 'fdCacheSize' => $zimbra['mailboxd-total']['fd_cache_size'], 'fdCacheHitRate' => $zimbra['mailboxd-total']['fd_cache_hit_rate'], 'aclCacheHitRate' => $zimbra['mailboxd-total']['acl_cache_hit_rate'], 'accountCacheSize' => $zimbra['mailboxd-total']['account_cache_size'], 'accountCacheHitRate' => $zimbra['mailboxd-total']['account_cache_hit_rate'], 'cosCacheSize' => $zimbra['mailboxd-total']['cos_cache_size'], 'cosCacheHitRate' => $zimbra['mailboxd-total']['cos_cache_hit_rate'], 'domainCacheSize' => $zimbra['mailboxd-total']['domain_cache_size'], 'domainCacheHitRate' => $zimbra['mailboxd-total']['domain_cache_hit_rate'], 'serverCacheSize' => $zimbra['mailboxd-total']['server_cache_size'], 'serverCacheHitRate' => $zimbra['mailboxd-total']['server_cache_hit_rate'], 'ucsvcCacheSize' => $zimbra['mailboxd-total']['ucservice_cache_size'], 'ucsvcCacheHitRate' => $zimbra['mailboxd-total']['ucservice_cache_hit_rate'], 'zimletCacheSize' => $zimbra['mailboxd-total']['zimlet_cache_size'], 'zimletCacheHitRate' => $zimbra['mailboxd-total']['zimlet_cache_hit_rate'], 'groupCacheSize' => $zimbra['mailboxd-total']['group_cache_size'], 'groupCacheHitRate' => $zimbra['mailboxd-total']['group_cache_hit_rate'], 'xmppCacheSize' => $zimbra['mailboxd-total']['xmpp_cache_size'], 'xmppCacheHitRate' => $zimbra['mailboxd-total']['xmpp_cache_hit_rate'], 'gcParnewCount' => $zimbra['mailboxd-total']['gc_parnew_count'], 'gcParnewMs' => $zimbra['mailboxd-total']['gc_parnew_ms'], 'gcConcmarksweepCnt' => $zimbra['mailboxd-total']['gc_concurrentmarksweep_count'], 'gcConcmarksweepMs' => $zimbra['mailboxd-total']['gc_concurrentmarksweep_ms'], 'gcMinorCount' => $zimbra['mailboxd-total']['gc_minor_count'], 'gcMinorMs' => $zimbra['mailboxd-total']['gc_minor_ms'], 'gcMajorCount' => $zimbra['mailboxd-total']['gc_major_count'], 'gcMajorMs' => $zimbra['mailboxd-total']['gc_major_ms'], 'mpoolCodeCacheUsed' => $zimbra['mailboxd-total']['mpool_code_cache_used'], 'mpoolCodeCacheFree' => $zimbra['mailboxd-total']['mpool_code_cache_free'], 'mpoolParEdenSpcUsed' => $zimbra['mailboxd-total']['mpool_par_eden_space_used'], 'mpoolParEdenSpcFree' => $zimbra['mailboxd-total']['mpool_par_eden_space_free'], 'mpoolParSurvSpcUsed' => $zimbra['mailboxd-total']['mpool_par_survivor_space_used'], 'mpoolParSurvSpcFree' => $zimbra['mailboxd-total']['mpool_par_survivor_space_free'], 'mpoolCmsOldGenUsed' => $zimbra['mailboxd-total']['mpool_cms_old_gen_used'], 'mpoolCmsOldGenFree' => $zimbra['mailboxd-total']['mpool_cms_old_gen_free'], 'mpoolCmsPermGenUsed' => $zimbra['mailboxd-total']['mpool_cms_perm_gen_used'], 'mpoolCmsPermGenFree' => $zimbra['mailboxd-total']['mpool_cms_perm_gen_free'], 'heapUsed' => $zimbra['mailboxd-total']['heap_used'], 'heapFree' => $zimbra['mailboxd-total']['heap_free']));
 }
 if (is_array($zimbra['proc'])) {
     /*
     timestamp, system, user, sys, idle, iowait, mailbox, mailbox-total-cpu, mailbox-utime, mailbox-stime, mailbox-totalMB, mailbox-rssMB, mailbox-sharedMB, mailbox-process-count, mysql, mysql-total-cpu, mysql-utime, mysql-stime, mysql-totalMB, mysql-rssMB, mysql-sharedMB, mysql-process-count, convertd, convertd-total-cpu, convertd-utime, convertd-stime, convertd-totalMB, convertd-rssMB, convertd-sharedMB, convertd-process-count, ldap, ldap-total-cpu, ldap-utime, ldap-stime, ldap-totalMB, ldap-rssMB, ldap-sharedMB, ldap-process-count, postfix, postfix-total-cpu, postfix-utime, postfix-stime, postfix-totalMB, postfix-rssMB, postfix-sharedMB, postfix-process-count, amavis, amavis-total-cpu, amavis-utime, amavis-stime, amavis-totalMB, amavis-rssMB, amavis-sharedMB, amavis-process-count, clam, clam-total-cpu, clam-utime, clam-stime, clam-totalMB, clam-rssMB, clam-sharedMB, clam-process-count, zmstat, zmstat-total-cpu, zmstat-utime, zmstat-stime, zmstat-totalMB, zmstat-rssMB, zmstat-sharedMB, zmstat-process-count
     04/27/2013 18:05:30, system, 3.9, 1.0, 94.4, 0.7, mailbox, 0.4, 0.4, 0.0, 1074.9, 863.8, 5.8, 1, mysql, 0.1, 0.1, 0.0, 956.5, 785.3, 4.1, 1, convertd, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, ldap, 0.0, 0.0, 0.0, 82300.6, 50.0, 4.5, 1, postfix, 0.0, 0.0, 0.0, 54.1, 1.5, 0.6, 5, amavis, 0.0, 0.0, 0.0, 150.8, 52.3, 3.4, 11, clam, 0.0, 0.0, 0.0, 42.4, 1.9, 1.0, 2, zmstat, 0.1, 0.1, 0.0, 4.0, 0.6, 0.4, 15
     */
     foreach (array('mailbox', 'mysql', 'convertd', 'ldap', 'postfix', 'amavis', 'clam', 'zmstat') as $app) {
         if ($zimbra['proc'][0][$app . '-process-count']) {
             rrdtool_update_ng($device, 'zimbra-proc', array('totalCPU' => $zimbra['proc'][0]["{$app}-total-cpu"], 'utime' => $zimbra['proc'][0]["{$app}-utime"], 'stime' => $zimbra['proc'][0]["{$app}-stime"], 'totalMB' => $zimbra['proc'][0]["{$app}-totalMB"], 'rssMB' => $zimbra['proc'][0]["{$app}-rssMB"], 'sharedMB' => $zimbra['proc'][0]["{$app}-sharedMB"], 'processCount' => $zimbra['proc'][0]["{$app}-process-count"]), $app);
         }
     }
 }
 /// FIXME - All commands listed in a year of my CSVs - may be incomplete?
 $commandlist['imap'] = array('APPEND', 'AUTHENTICATE', 'BASIC', 'CAPABILITY', 'CHECK', 'CLOSE', 'CREATE', 'DELETE', 'ENABLE', 'EXAMINE', 'EXPUNGE', 'FETCH', 'GETACL', 'GETQUOTAROOT', 'ID', 'IDLE', 'LIST', 'LOGIN', 'LOGOUT', 'LSUB', 'MYRIGHTS', 'NAMESPACE', 'NOOP', 'RENAME', 'SEARCH', 'SELECT', 'STARTTLS', 'STATUS', 'STORE', 'SUBSCRIBE', 'UID', 'UNSELECT', 'UNSUBSCRIBE', 'XLIST');
 $commandlist['ldap'] = array('CREATE_ENTRY', 'DELETE_ENTRY', 'GET_CONN', 'GET_ENTRY', 'GET_SCHEMA', 'MODIFY_ATTRS', 'OPEN_CONN', 'SEARCH_ACCOUNT_BY_ID', 'SEARCH_ACCOUNT_BY_NAME', 'SEARCH_ACCOUNTS_BY_GRANTS', 'SEARCH_ACCOUNTS_HOMED_ON_SERVER', 'SEARCH_ACCOUNTS_HOMED_ON_SERVER_ACCOUNTS_ONLY', 'SEARCH_ADMIN_ACCOUNT_BY_RDN', 'SEARCH_ADMIN_SEARCH', 'SEARCH_ALL_ALIASES', 'SEARCH_ALL_CALENDAR_RESOURCES', 'SEARCH_ALL_DATA_SOURCES', 'SEARCH_ALL_GROUPS', 'SEARCH_ALL_IDENTITIES', 'SEARCH_ALL_MIME_ENTRIES', 'SEARCH_ALL_NON_SYSTEM_ACCOUNTS', 'SEARCH_ALL_NON_SYSTEM_ARCHIVING_ACCOUNTS', 'SEARCH_ALL_NON_SYSTEM_INTERNAL_ACCOUNTS', 'SEARCH_ALL_SERVERS', 'SEARCH_ALL_SIGNATURES', 'SEARCH_ALL_UC_SERVICES', 'SEARCH_ALL_ZIMLETS', 'SEARCH_DATA_SOURCE_BY_ID', 'SEARCH_DISTRIBUTION_LIST_BY_ID', 'SEARCH_DISTRIBUTION_LIST_BY_NAME', 'SEARCH_DISTRIBUTION_LISTS_BY_MEMBER_ADDRS', 'SEARCH_DOMAIN_BY_ID', 'SEARCH_DOMAIN_BY_NAME', 'SEARCH_DOMAIN_BY_VIRTUAL_HOSTNAME', 'SEARCH_DYNAMIC_GROUP_BY_NAME', 'SEARCH_DYNAMIC_GROUPS_STATIC_UNIT_BY_MEMBER_ADDR', 'SEARCH_EXTERNAL_ACCOUNTS_HOMED_ON_SERVER', 'SEARCH_GAL_SEARCH', 'SEARCH_GROUP_BY_ID', 'SEARCH_GROUP_BY_NAME', 'SEARCH_LDAP_AUTHENTICATE', 'SEARCH_MIME_ENTRY_BY_MIME_TYPE', 'SEARCH_SEARCH_GRANTEE', 'SEARCH_SERVER_BY_SERVICE', 'SEARCH_SHARE_LOCATOR_BY_ID', 'SEARCH_TODO');
 $commandlist['pop3'] = array('DELE', 'LIST', 'RETR', 'QUIT', 'STAT');
 $commandlist['sync'] = array('FolderSync', 'GetAttachment', 'GetItemEstimate', 'ItemOperations', 'MeetingResponse', 'MoveItems', 'Ping_after_suspend', 'Ping_before_suspend', 'Provision', 'Search', 'Settings', 'Sync');
 $commandlist['soap'] = array('ActivateLicenseRequest', 'AddAccountAliasRequest', 'AddDistributionListAliasRequest', 'AddDistributionListMemberRequest', 'AddMsgRequest', 'ApplyFilterRulesRequest', 'AuthRequest', 'AutoCompleteGalRequest', 'AutoCompleteRequest', 'BackupQueryRequest', 'BackupRequest', 'BrowseRequest', 'BulkImportAccountsRequest', 'CancelAppointmentRequest', 'CancelTaskRequest', 'ChangePasswordRequest', 'CheckAuthConfigRequest', 'CheckLicenseRequest', 'CheckPermissionRequest', 'CheckRecurConflictsRequest', 'CheckRightsRequest', 'CheckSpellingRequest', 'ClearCookieRequest', 'ComputeAggregateQuotaUsageRequest', 'ContactActionRequest.delete', 'ContactActionRequest.move', 'ContactActionRequest.update', 'ConvActionRequest.delete', 'ConvActionRequest.flag', 'ConvActionRequest.!flag', 'ConvActionRequest.move', 'ConvActionRequest.read', 'ConvActionRequest.!read', 'ConvActionRequest.spam', 'ConvActionRequest.!spam', 'ConvActionRequest.trash', 'CounterAppointmentRequest', 'CountObjectsRequest', 'CreateAccountRequest', 'CreateAppointmentExceptionRequest', 'CreateAppointmentRequest', 'CreateCalendarResourceRequest', 'CreateContactRequest', 'CreateDistributionListRequest', 'CreateDomainRequest', 'CreateFolderRequest', 'CreateGalSyncAccountRequest', 'CreateIdentityRequest', 'CreateMountpointRequest', 'CreateSignatureRequest', 'CreateTagRequest', 'CreateTaskRequest', 'CreateWaitSetRequest', 'DelegateAuthRequest', 'DeleteAccountRequest', 'DeleteCalendarResourceRequest', 'DeleteIdentityRequest', 'DeleteSignatureRequest', 'DestroyWaitSetRequest', 'DiscoverRightsRequest', 'DismissCalendarItemAlarmRequest', 'EndSessionRequest', 'FlushCacheRequest', 'FolderActionRequest.check', 'FolderActionRequest.!check', 'FolderActionRequest.color', 'FolderActionRequest.delete', 'FolderActionRequest.empty', 'FolderActionRequest.grant', 'FolderActionRequest.!grant', 'FolderActionRequest.move', 'FolderActionRequest.read', 'FolderActionRequest.rename', 'FolderActionRequest.retentionpolicy', 'FolderActionRequest.revokeorphangrants', 'FolderActionRequest.trash', 'FolderActionRequest.update', 'ForwardAppointmentRequest', 'GenerateBulkProvisionFileFromLDAPRequest', 'GetAccountDistributionListsRequest', 'GetAccountInfoRequest', 'GetAccountMembershipRequest', 'GetAccountRequest', 'GetAdminConsoleUICompRequest', 'GetAdminExtensionZimletsRequest', 'GetAdminSavedSearchesRequest', 'GetAggregateQuotaUsageOnServerRequest', 'GetAllConfigRequest', 'GetAllCosRequest', 'GetAllRightsRequest', 'GetAllServersRequest', 'GetAllSkinsRequest', 'GetAllUCProvidersRequest', 'GetAllUCServicesRequest', 'GetAllVolumesRequest', 'GetAllZimletsRequest', 'GetAppointmentRequest', 'GetAttributeInfoRequest', 'GetAvailableCsvFormatsRequest', 'GetAvailableLocalesRequest', 'GetAvailableSkinsRequest', 'GetBulkIMAPImportTaskListRequest', 'GetCalendarResourceRequest', 'GetCertRequest', 'GetConfigRequest', 'GetContactsRequest', 'GetConvRequest', 'GetCosRequest', 'GetCreateObjectAttrsRequest', 'GetCSRRequest', 'GetCurrentVolumesRequest', 'GetDataSourcesRequest', 'GetDevicesCountRequest', 'GetDeviceStatusRequest', 'GetDistributionListMembershipRequest', 'GetDistributionListMembersRequest', 'GetDistributionListRequest', 'GetDomainInfoRequest', 'GetDomainRequest', 'GetEffectiveRightsRequest', 'GetFilterRulesRequest', 'GetFolderRequest', 'GetFreeBusyRequest', 'GetGrantsRequest', 'GetHsmStatusRequest', 'GetIdentitiesRequest', 'GetInfoRequest', 'GetItemRequest', 'GetLicenseRequest', 'GetLoggerStatsRequest', 'GetMailboxMetadataRequest', 'GetMailboxRequest', 'GetMailQueueInfoRequest', 'GetMailQueueRequest', 'GetMiniCalRequest', 'GetMsgRequest', 'GetOutgoingFilterRulesRequest', 'GetPermissionRequest', 'GetPrefsRequest', 'GetQuotaUsageRequest', 'GetRightRequest', 'GetRightsRequest', 'GetServerNIfsRequest', 'GetServerRequest', 'GetServiceStatusRequest', 'GetSessionsRequest', 'GetShareInfoRequest', 'GetSignaturesRequest', 'GetSystemRetentionPolicyRequest', 'GetTaskRequest', 'GetVersionInfoRequest', 'GetWhiteBlackListRequest', 'GetWorkingHoursRequest', 'GrantPermissionRequest', 'GrantRightsRequest', 'ImportAppointmentsRequest', 'InstallLicenseRequest', 'ItemActionRequest.copy', 'ItemActionRequest.delete', 'ItemActionRequest.move', 'ItemActionRequest.read', 'ItemActionRequest.!read', 'ItemActionRequest.tag', 'ItemActionRequest.!tag', 'ItemActionRequest.trash', 'ItemActionRequest.update', 'MailQueueActionRequest', 'ModifyAccountRequest', 'ModifyAdminSavedSearchesRequest', 'ModifyAppointmentRequest', 'ModifyCalendarResourceRequest', 'ModifyConfigRequest', 'ModifyContactRequest', 'ModifyCosRequest', 'ModifyDistributionListRequest', 'ModifyDomainRequest', 'ModifyFilterRulesRequest', 'ModifyIdentityRequest', 'ModifyPrefsRequest', 'ModifyPropertiesRequest', 'ModifyServerRequest', 'ModifySignatureRequest', 'ModifyTaskRequest', 'ModifyWhiteBlackListRequest', 'ModifyZimletPrefsRequest', 'MsgActionRequest.delete', 'MsgActionRequest.flag', 'MsgActionRequest.!flag', 'MsgActionRequest.move', 'MsgActionRequest.read', 'MsgActionRequest.!read', 'MsgActionRequest.spam', 'MsgActionRequest.trash', 'MsgActionRequest.update', 'NoOpRequest', 'RankingActionRequest.delete', 'RemoveAccountAliasRequest', 'RemoveDeviceRequest', 'RemoveDistributionListMemberRequest', 'RenameAccountRequest', 'SaveDocumentRequest', 'SaveDraftRequest', 'SearchCalendarResourcesRequest', 'SearchConvRequest', 'SearchDirectoryRequest', 'SearchGalRequest', 'SearchRequest', 'SendDeliveryReportRequest', 'SendInviteReplyRequest', 'SendMsgRequest', 'SendShareNotificationRequest', 'SetAppointmentRequest', 'SetMailboxMetadataRequest', 'SetTaskRequest', 'SnoozeCalendarItemAlarmRequest', 'SyncGalAccountRequest', 'SyncGalRequest', 'SyncRequest', 'UndeployZimletRequest', 'VersionCheckRequest', 'WaitSetRequest');
 /// FIXME ldap & soap currently disabled: command names longer than allowed DS length
 foreach (array('imap', 'pop3', 'sync') as $protocol) {
     if (is_array($zimbra[$protocol])) {
         /*
         timestamp,command,exec_count,exec_ms_avg
         04/27/2013 22:33:38,CHECK,1,0
예제 #12
0
# tcp-client-overflow     0
# tcp-questions   20830
# unauthorized-tcp        0
# unauthorized-udp        0
# unexpected-packets      0
# cache-entries   710696
# cache-hits      548700
# cache-misses    5155665
# concurrent-queries      1
# negcache-entries        45659
# nsspeeds-entries        3023
# packetcache-entries     271504
# packetcache-hits        5393402
# packetcache-misses      5683536
# sys-msec        1600408
# tcp-clients     0
# throttle-entries        56
# uptime  4231654
# user-msec       3423357
if (!empty($agent_data['app']['powerdns-recursor'])) {
    $app_id = discover_app($device, 'powerdns-recursor');
    foreach (explode("\n", $agent_data['app']['powerdns-recursor']) as $line) {
        list($key, $value) = explode("\t", $line, 2);
        $powerdns_recursor[$key] = $value;
    }
    $data = array('outQ_all' => $powerdns_recursor['all-outqueries'], 'outQ_dont' => $powerdns_recursor['dont-outqueries'], 'outQ_tcp' => $powerdns_recursor['tcp-outqueries'], 'outQ_throttled' => $powerdns_recursor['throttled-out'], 'outQ_ipv6' => $powerdns_recursor['ipv6-outqueries'], 'outQ_noEDNS' => $powerdns_recursor['noedns-outqueries'], 'outQ_noPing' => $powerdns_recursor['noping-outqueries'], 'drop_reqDlgOnly' => $powerdns_recursor['dlg-only-drops'], 'drop_overCap' => $powerdns_recursor['over-capacity-drops'], 'timeoutOutgoing' => $powerdns_recursor['outgoing-timeouts'], 'unreachables' => $powerdns_recursor['unreachables'], 'answers_1s' => $powerdns_recursor['answers-slow'], 'answers_1ms' => $powerdns_recursor['answers0-1'], 'answers_10ms' => $powerdns_recursor['answers1-10'], 'answers_100ms' => $powerdns_recursor['answers10-100'], 'answers_1000ms' => $powerdns_recursor['answers100-1000'], 'answers_noerror' => $powerdns_recursor['noerror-answers'], 'answers_nxdomain' => $powerdns_recursor['nxdomain-answers'], 'answers_servfail' => $powerdns_recursor['servfail-answers'], 'caseMismatch' => $powerdns_recursor['case-mismatches'], 'chainResends' => $powerdns_recursor['chain-resends'], 'clientParseErrors' => $powerdns_recursor['client-parse-errors'], 'ednsPingMatch' => $powerdns_recursor['edns-ping-matches'], 'ednsPingMismatch' => $powerdns_recursor['edns-ping-mismatches'], 'noPacketError' => $powerdns_recursor['no-packet-error'], 'nssetInvalidations' => $powerdns_recursor['nsset-invalidations'], 'qaLatency' => $powerdns_recursor['qa-latency'], 'questions' => $powerdns_recursor['questions'], 'resourceLimits' => $powerdns_recursor['resource-limits'], 'serverParseErrors' => $powerdns_recursor['server-parse-errors'], 'spoofPrevents' => $powerdns_recursor['spoof-prevents'], 'tcpClientOverflow' => $powerdns_recursor['tcp-client-overflow'], 'tcpQuestions' => $powerdns_recursor['tcp-questions'], 'tcpUnauthorized' => $powerdns_recursor['unauthorized-tcp'], 'udpUnauthorized' => $powerdns_recursor['unauthorized-udp'], 'cacheEntries' => $powerdns_recursor['cache-entries'], 'cacheHits' => $powerdns_recursor['cache-hits'], 'cacheMisses' => $powerdns_recursor['cache-misses'], 'negcacheEntries' => $powerdns_recursor['negcache-entries'], 'nsSpeedsEntries' => $powerdns_recursor['nsspeeds-entries'], 'packetCacheEntries' => $powerdns_recursor['packetcache-entries'], 'packetCacheHits' => $powerdns_recursor['packetcache-hits'], 'packetCacheMisses' => $powerdns_recursor['packetcache-misses'], 'unexpectedPkts' => $powerdns_recursor['unexpected-packets'], 'concurrentQueries' => $powerdns_recursor['concurrent-queries'], 'tcpClients' => $powerdns_recursor['tcp-clients'], 'throttleEntries' => $powerdns_recursor['throttle-entries'], 'uptime' => $powerdns_recursor['uptime'], 'cpuTimeSys' => $powerdns_recursor['sys-msec'], 'cpuTimeUser' => $powerdns_recursor['user-msec']);
    rrdtool_update_ng($device, 'powerdns-recursor', $data, $app_id);
    update_application($app_id, $data);
    unset($powerdns_recursor);
}
// EOF
예제 #13
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['nginx'])) {
    $nginx = $agent_data['app']['nginx'];
    $app_id = discover_app($device, 'nginx');
    echo ' nginx statistics' . PHP_EOL;
    list($active, $reading, $writing, $waiting, $req) = explode("\n", $nginx);
    $data = array('Requests' => $req, 'Active' => $active, 'Reading' => $reading, 'Writing' => $writing, 'Waiting' => $waiting);
    rrdtool_update_ng($device, 'nginx', $data, $app_id);
    update_application($app_id, $data);
    unset($nginx, $active, $reading, $writing, $req);
}
// EOF
예제 #14
0
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['mysql'])) {
    $app_id = discover_app($device, 'mysql');
    $map = array();
    foreach (explode("\n", $agent_data['app']['mysql']) as $str) {
        list($key, $value) = explode(":", $str);
        $map[$key] = trim($value);
    }
    // General Stats
    $mapping = array('IDBLBSe' => 'cr', 'IBLFh' => 'ct', 'IBLWn' => 'cu', 'IBLWn' => 'cu', 'SRows' => 'ck', 'SRange' => 'cj', 'SMPs' => 'ci', 'SScan' => 'cl', 'IBIRd' => 'ai', 'IBIWr' => 'aj', 'IBILg' => 'ak', 'IBIFSc' => 'ah', 'IDBRDd' => 'b2', 'IDBRId' => 'b0', 'IDBRRd' => 'b3', 'IDBRUd' => 'b1', 'IBRd' => 'ae', 'IBCd' => 'af', 'IBWr' => 'ag', 'TLIe' => 'b5', 'TLWd' => 'b4', 'IBPse' => 'aa', 'IBPDBp' => 'ac', 'IBPFe' => 'ab', 'IBPMps' => 'ad', 'TOC' => 'bc', 'OFs' => 'b7', 'OTs' => 'b8', 'OdTs' => 'b9', 'IBSRs' => 'ay', 'IBSWs' => 'ax', 'IBOWs' => 'az', 'QCs' => 'c1', 'QCeFy' => 'bu', 'MaCs' => 'bl', 'MUCs' => 'bf', 'ACs' => 'bd', 'AdCs' => 'be', 'TCd' => 'bi', 'Cs' => 'bn', 'IBTNx' => 'a5', 'KRRs' => 'a0', 'KRs' => 'a1', 'KWR' => 'a2', 'KWs' => 'a3', 'QCQICe' => 'bz', 'QCHs' => 'bv', 'QCIs' => 'bw', 'QCNCd' => 'by', 'QCLMPs' => 'bx', 'CTMPDTs' => 'cn', 'CTMPTs' => 'cm', 'CTMPFs' => 'co', 'IBIIs' => 'au', 'IBIMRd' => 'av', 'IBIMs' => 'aw', 'IBILog' => 'al', 'IBISc' => 'am', 'IBIFLg' => 'an', 'IBFBl' => 'aq', 'IBIIAo' => 'ap', 'IBIAd' => 'as', 'IBIAe' => 'at', 'SFJn' => 'cd', 'SFRJn' => 'ce', 'SRe' => 'cf', 'SRCk' => 'cg', 'SSn' => 'ch', 'SQs' => 'b6', 'BRd' => 'cq', 'BSt' => 'cp', 'CDe' => 'c6', 'CIt' => 'c4', 'CISt' => 'ca', 'CLd' => 'c8', 'CRe' => 'c7', 'CRSt' => 'cc', 'CSt' => 'c5', 'CUe' => 'c3', 'CUMi' => 'c9');
    $values = array();
    foreach ($mapping as $key => $value) {
        $values[$key] = $map[$value];
    }
    rrdtool_update_ng($device, 'mysql', $values, $app_id);
    // Process state statistics
    // Derr, not sure what the key part of the array is for, apart from some documentation, as d* is passed from agent into RRD.
    $mapping_status = array('State_closing_tables' => 'd2', 'State_copying_to_tmp_table' => 'd3', 'State_end' => 'd4', 'State_freeing_items' => 'd5', 'State_init' => 'd6', 'State_locked' => 'd7', 'State_login' => 'd8', 'State_preparing' => 'd9', 'State_reading_from_net' => 'da', 'State_sending_data' => 'db', 'State_sorting_result' => 'dc', 'State_statistics' => 'dd', 'State_updating' => 'de', 'State_writing_to_net' => 'df', 'State_none' => 'dg', 'State_other' => 'dh');
    $valuesb = array();
    foreach ($mapping_status as $key => $value) {
        $valuesb[$value] = $map[$value];
    }
    update_application($app_id, array_merge($values, $valuesb));
    rrdtool_update_ng($device, 'mysql-status', $valuesb, $app_id);
}
// EOF
예제 #15
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// Correct output of the agent script should look like this:
//<<<exim-mailqueue>>>
//frozen:173
//bounces:1052
//total:2496
//active:2323
if (!empty($agent_data['app']['exim-mailqueue'])) {
    $app_id = discover_app($device, 'exim-mailqueue');
    foreach (explode("\n", $agent_data['app']['exim-mailqueue']) as $line) {
        list($item, $value) = explode(":", $line, 2);
        $exim_data[trim($item)] = trim($value);
    }
    update_application($app_id, $exim_data);
    rrdtool_update_ng($device, 'exim-mailqueue', $exim_data, $app_id);
    unset($line, $item, $value, $exim_data, $app_id);
}
// EOF
예제 #16
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['apache'])) {
    $app_id = discover_app($device, 'apache');
    list($total_access, $total_kbyte, $cpuload, $uptime, $reqpersec, $bytespersec, $bytesperreq, $busyworkers, $idleworkers, $score_wait, $score_start, $score_reading, $score_writing, $score_keepalive, $score_dns, $score_closing, $score_logging, $score_graceful, $score_idle, $score_open) = explode("\n", $agent_data['app']['apache']);
    update_application($app_id, array('access' => $total_access, 'kbyte' => $total_kbyte, 'cpu' => $cpuload, 'uptime' => $uptime, 'reqpersec' => $reqpersec, 'bytespersec' => $bytespersec, 'byesperreq' => $bytesperreq, 'busyworkers' => $busyworkers, 'idleworkers' => $idleworkers, 'sb_wait' => $score_wait, 'sb_start' => $score_start, 'sb_reading' => $score_reading, 'sb_writing' => $score_writing, 'sb_keepalive' => $score_keepalive, 'sb_dns' => $score_dns, 'sb_closing' => $score_closing, 'sb_logging' => $score_logging, 'sb_graceful' => $score_graceful, 'sb_idle' => $score_idle, 'sb_open' => $score_open));
    rrdtool_update_ng($device, 'apache', array('access' => $total_access, 'kbyte' => $total_kbyte, 'cpu' => $cpuload, 'uptime' => $uptime, 'reqpersec' => $reqpersec, 'bytespersec' => $bytespersec, 'byesperreq' => $bytesperreq, 'busyworkers' => $busyworkers, 'idleworkers' => $idleworkers, 'sb_wait' => $score_wait, 'sb_start' => $score_start, 'sb_reading' => $score_reading, 'sb_writing' => $score_writing, 'sb_keepalive' => $score_keepalive, 'sb_dns' => $score_dns, 'sb_closing' => $score_closing, 'sb_logging' => $score_logging, 'sb_graceful' => $score_graceful, 'sb_idle' => $score_idle, 'sb_open' => $score_open), $app_id);
}
// EOF
예제 #17
0
/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$vp_rows = dbFetchRows("SELECT * FROM `ports` AS P, `juniAtmVp` AS J WHERE P.`device_id` = ? AND J.port_id = P.port_id", array($device['device_id']));
if (count($vp_rows)) {
    $vp_cache = array();
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInCells", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPackets", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutCells", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPackets", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB");
    $vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB");
    echo "Checking JunOSe ATM vps: ";
    foreach ($vp_rows as $vp) {
        echo ".";
        rrdtool_update_ng($device, 'junos-atm-vp', array('incells' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsInCells'], 'outcells' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsOutCells'], 'inpackets' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsInPackets'], 'outpackets' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsOutPackets'], 'inpacketoctets' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsInPacketOctets'], 'outpacketoctets' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsOutPacketOctets'], 'inpacketerrors' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsInPacketErrors'], 'outpacketerrors' => $vp_cache[$vp['ifIndex'] . "." . $vp['vp_id']]['juniAtmVpStatsOutPacketErrors']), $vp['ifIndex'] . '-' . $vp['vp_id']);
    }
    echo "\n";
    unset($vp_cache);
}
// EOF
예제 #18
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// FIXME - INSTANCES
if (!empty($agent_data['app']['shoutcast'])) {
    $app_id = discover_app($device, 'shoutcast');
    // Polls shoutcast statistics from agent script
    $servers = explode("\n", $agent_data['app']['shoutcast']);
    $data = array();
    foreach ($servers as $item => $server) {
        $server = trim($server);
        if (!empty($server)) {
            $data = explode(";", $server);
            list($host, $port) = explode(":", $data[0], 2);
            $stats[$data[0]] = array('bitrate' => $data[1], 'traf_in' => $data[2], 'traf_out' => $data[3], 'current' => $data[4], 'status' => $data[5], 'peak' => $data[6], 'max' => $data[7], 'unique' => $data[8]);
            rrdtool_update_ng($device, 'shoutcast', $stats[$data[0]], "{$app_id}-" . $host . "_" . $port);
        }
    }
    update_application($app_id, $stats);
    unset($app_id, $host, $port, $data, $servers, $server, $item);
}
// EOF
#CISCO-IPSEC-FLOW-MONITOR-MIB::cipSecGlobalProtocolUseFails.0 = Counter32: 0 Failures
#CISCO-IPSEC-FLOW-MONITOR-MIB::cipSecGlobalNoSaFails.0 = Counter32: 5 Failures
#CISCO-IPSEC-FLOW-MONITOR-MIB::cipSecGlobalSysCapFails.0 = Counter32: 0 Failures
// FIXME. Candidate for migrate to graphs module with table_collect()
if (is_device_mib($device, 'CISCO-IPSEC-FLOW-MONITOR-MIB')) {
    $data = snmpwalk_cache_oid($device, "cipSecGlobalStats", NULL, "CISCO-IPSEC-FLOW-MONITOR-MIB");
    $data = $data[0];
    // Use HC Counters if they exist
    if (is_numeric($data['cipSecGlobalHcInOctets'])) {
        $data['cipSecGlobalInOctets'] = $data['cipSecGlobalHcInOctets'];
    }
    if (is_numeric($data['cipSecGlobalHcOutOctets'])) {
        $data['cipSecGlobalOutOctets'] = $data['cipSecGlobalHcOutOctets'];
    }
    if (is_numeric($data['cipSecGlobalHcInDecompOctets'])) {
        $data['cipSecGlobalInDecompOctets'] = $data['cipSecGlobalHcInDecompOctets'];
    }
    if (is_numeric($data['cipSecGlobalHcOutUncompOctets'])) {
        $data['cipSecGlobalOutUncompOctets'] = $data['cipSecGlobalHcOutUncompOctets'];
    }
    if ($data['cipSecGlobalActiveTunnels']) {
        rrdtool_update_ng($device, 'cipsec-flow', array('Tunnels' => $data['cipSecGlobalActiveTunnels'], 'InOctets' => $data['cipSecGlobalInOctets'], 'OutOctets' => $data['cipSecGlobalOutOctets'], 'InDecompOctets' => $data['cipSecGlobalInDecompOctets'], 'OutUncompOctets' => $data['cipSecGlobalOutUncompOctets'], 'InPkts' => $data['cipSecGlobalInPkts'], 'OutPkts' => $data['cipSecGlobalOutPkts'], 'InDrops' => $data['cipSecGlobalInDrops'], 'InReplayDrops' => $data['cipSecGlobalInReplayDrops'], 'OutDrops' => $data['cipSecGlobalOutDrops'], 'InAuths' => $data['cipSecGlobalInAuths'], 'OutAuths' => $data['cipSecGlobalOutAuths'], 'InAuthFails' => $data['cipSecGlobalInAuthFails'], 'OutAuthFails' => $data['cipSecGlobalOutAuthFails'], 'InDecrypts' => $data['cipSecGlobalInDecrypts'], 'OutEncrypts' => $data['cipSecGlobalOutEncrypts'], 'InDecryptFails' => $data['cipSecGlobalInDecryptFails'], 'OutEncryptFails' => $data['cipSecGlobalOutEncryptFails'], 'ProtocolUseFails' => $data['cipSecGlobalProtocolUseFails'], 'NoSaFails' => $data['cipSecGlobalNoSaFails'], 'SysCapFails' => $data['cipSecGlobalSysCapFails']));
        $graphs['cipsec_flow_tunnels'] = TRUE;
        $graphs['cipsec_flow_pkts'] = TRUE;
        $graphs['cipsec_flow_bits'] = TRUE;
        $graphs['cipsec_flow_stats'] = TRUE;
        echo " cipsec_flow";
    }
    unset($data);
}
// EOF
예제 #20
0
                 $cef_stat['cefSwitchingPunt'] = $cef_stat['cefSwitchingHCPunt'];
             }
             if (is_numeric($cef_stat['cefSwitchingHCPunt2Host'])) {
                 $cef_stat['cefSwitchingPunt2Host'] = $cef_stat['cefSwitchingHCPunt2Host'];
             }
             // FIXME -- memory tables
             $cef_stat['update']['drop'] = $cef_stat['cefSwitchingDrop'];
             $cef_stat['update']['punt'] = $cef_stat['cefSwitchingPunt'];
             $cef_stat['update']['punt2host'] = $cef_stat['cefSwitchingPunt2Host'];
             $cef_stat['update']['drop_prev'] = $cef_entry['drop'];
             $cef_stat['update']['punt_prev'] = $cef_entry['punt'];
             $cef_stat['update']['punt2host_prev'] = $cef_entry['punt2host'];
             $cef_stat['update']['updated'] = $polled;
             $cef_stat['update']['updated_prev'] = $cef_entry['updated'];
             dbUpdate($cef_stat['update'], 'cef_switching', '`device_id` = ? AND `entPhysicalIndex` = ? AND `afi` = ? AND `cef_index` = ?', array($device['device_id'], $entity, $afi, $path));
             rrdtool_update_ng($device, 'cisco-cef-switching', array('drop' => $cef_stat['cefSwitchingDrop'], 'punt' => $cef_stat['cefSwitchingPunt'], 'hostpunt' => $cef_stat['cefSwitchingPunt2Host']), "{$entity}-{$afi}-{$path}");
             echo PHP_EOL;
         }
     }
 }
 //print_vars($cefs_db);
 foreach ($cefs_db as $cef_switching_id) {
     dbDelete('cef_switching', '`cef_switching_id` =  ?', array($cef_switching_id));
     echo '-';
 }
 foreach ($cef_pfxs_db as $afis) {
     foreach ($afis as $pfx_id) {
         dbDelete('cef_prefix', '`cef_pfx_id` =  ?', array($pfx_id));
         echo '-';
     }
 }
예제 #21
0
     $agent_port = $override_port;
 }
 $agent_start = utime();
 $agent_socket = "tcp://" . $device['hostname'] . ":" . $agent_port;
 $agent = @stream_socket_client($agent_socket, $errno, $errstr, 10);
 if (!$agent) {
     print_warning("Connection to UNIX agent on " . $agent_socket . " failed. ERROR: " . $errno . " " . $errstr);
     logfile("UNIX-AGENT: Connection on " . $agent_socket . " failed. ERROR: " . $errno . " " . $errstr);
 } else {
     $agent_raw = stream_get_contents($agent);
 }
 $agent_end = utime();
 $agent_time = round(($agent_end - $agent_start) * 1000);
 if (!empty($agent_raw)) {
     echo "execution time: " . $agent_time . "ms";
     rrdtool_update_ng($device, 'agent', array('time' => $agent_time));
     $graphs['agent'] = TRUE;
     foreach (explode("<<<", $agent_raw) as $section) {
         list($section, $data) = explode(">>>", $section);
         $sa = '';
         $sb = '';
         $sc = '';
         # DO -NOT- ADD NEW CASES BELOW -- use <<<app-$foo>>> in your application script
         switch ($section) {
             // Compatibility with versions of scripts with and without app-
             // Disabled for DRBD because it falsely detects the check_mk output
             case "drbd":
                 $sa = "app";
                 $sb = "drbd";
                 break;
             case "apache":
예제 #22
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$version = preg_replace("/(.+)\\ version\\ (.+)\\ \\(SN:\\ (.+)\\,\\ (.+)\\)/", "\\1||\\2||\\3||\\4", $poll_device['sysDescr']);
list($hardware, $version, $serial, $features) = explode('||', $version);
$hardware = rewrite_junos_hardware($poll_device['sysObjectID']);
$snmpdata = snmp_get_multi($device, 'nsResSessAllocate.0 nsResSessMaxium.0 nsResSessFailed.0', '-OQUs', 'NETSCREEN-RESOURCE-MIB');
rrdtool_update_ng($device, 'screenos-sessions', array('allocate' => $snmpdata[0]['nsResSessAllocate'], 'max' => $snmpdata[0]['nsResSessMaxium'], 'failed' => $snmpdata[0]['nsResSessFailed']));
$graphs['screenos_sessions'] = TRUE;
// EOF
예제 #23
0
            }
            // Parse the data, first try key:value format
            $lines = explode("\n", $memcached_data);
            $fallback_to_values_only = False;
            foreach ($lines as $line) {
                // Fall back to values only if we don't see a : separator
                if (!strstr($line, ':')) {
                    $fallback_to_values_only = True;
                    break;
                }
                // Parse key:value line
                list($key, $value) = explode(':', $line, 2);
                $values[$key] = $value;
            }
            if ($fallback_to_values_only) {
                // See if we got the expected data
                if (count($keys) != count($lines)) {
                    // Skip this one, we don't know how to handle this data
                    echo "<- [skipped, incompatible data received] ";
                    continue;
                }
                // Combine keys and values
                echo "<- [old data format received, please upgrade agent] ";
                $values = array_combine($keys, $lines);
            }
            update_application($app_id, $values);
            rrdtool_update_ng($device, 'memcached', $values, $memcached_host);
        }
    }
}
// EOF
예제 #24
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (preg_match('/^Cisco(?: IronPort)? Model (?<hardware>[\\w\\-]+),.*AsyncOS Version: (?<version>[\\d\\.\\-]+),.*Serial #: (?<serial>[\\w\\-]+)/', $poll_device['sysDescr'], $matches)) {
    // Cisco IronPort Model C160, AsyncOS Version: 7.6.2-014, Build Date: 2012-11-02, Serial #: 99999AAA9AA9-99AAAA9
    // Cisco Model S380, AsyncOS Version: 8.8.0-085, Build Date: 2015-07-02, Serial #: 99999AAA9AA9-99AAAA9
    $hardware = $matches['hardware'];
    $version = $matches['version'];
    $serial = $matches['serial'];
}
// FIXME. Move to polling graphs
$workq_depth = snmp_get($device, 'workQueueMessages.0', '-Ovq', 'ASYNCOS-MAIL-MIB');
if (is_numeric($workq_depth)) {
    rrdtool_update_ng($device, 'asyncos-workq', array('DEPTH' => $workq_depth));
    //echo("Work Queue: $workq_depth\n");
    $graphs['asyncos_workq'] = TRUE;
}
// EOF
예제 #25
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @author     Kresimir Jurasovic, Tom Laermans
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!empty($agent_data['app']['jvmoverjmx'])) {
    foreach ($agent_data['app']['jvmoverjmx'] as $instance => $jvmoverjmx) {
        $app_id = discover_app($device, 'jvmoverjmx', $instance);
        echo " jvmoverjmx statistics" . PHP_EOL;
        foreach (explode("\n", $jvmoverjmx) as $jmxdataValue) {
            list($key, $value) = explode(':', $jmxdataValue);
            $jvmoverjmx_data[trim($key)] = trim($value);
        }
        $data = array('UpTime' => $jvmoverjmx_data['UpTime'], 'HeapMemoryMaxUsage' => $jvmoverjmx_data['HeapMemoryMaxUsage'], 'HeapMemoryUsed' => $jvmoverjmx_data['HeapMemoryUsed'], 'NonHeapMemoryMax' => $jvmoverjmx_data['NonHeapMemoryMax'], 'NonHeapMemoryUsed' => $jvmoverjmx_data['NonHeapMemoryUsed'], 'EdenSpaceMax' => $jvmoverjmx_data['EdenSpaceMax'], 'EdenSpaceUsed' => $jvmoverjmx_data['EdenSpaceUsed'], 'PermGenMax' => $jvmoverjmx_data['PermGenMax'], 'PermGenUsed' => $jvmoverjmx_data['PermGenUsed'], 'OldGenMax' => $jvmoverjmx_data['OldGenMax'], 'OldGenUsed' => $jvmoverjmx_data['OldGenUsed'], 'DaemonThreads' => $jvmoverjmx_data['DaemonThreads'], 'TotalThreads' => $jvmoverjmx_data['TotalThreads'], 'LoadedClassCount' => $jvmoverjmx_data['LoadedClassCount'], 'UnloadedClassCount' => $jvmoverjmx_data['UnloadedClassCount'], 'G1OldGenCount' => $jvmoverjmx_data['G1OldGenCollectionCount'], 'G1OldGenTime' => $jvmoverjmx_data['G1OldGenCollectionTime'], 'G1YoungGenCount' => $jvmoverjmx_data['G1YoungGenCollectionCount'], 'G1YoungGenTime' => $jvmoverjmx_data['G1YoungGenCollectionTime'], 'CMSCount' => $jvmoverjmx_data['CMSCollectionCount'], 'CMSTime' => $jvmoverjmx_data['CMSCollectionTime'], 'ParNewCount' => $jvmoverjmx_data['ParNewCollectionCount'], 'ParNewTime' => $jvmoverjmx_data['ParNewCollectionTime'], 'CopyCount' => $jvmoverjmx_data['CopyCollectionCount'], 'CopyTime' => $jvmoverjmx_data['CopyCollectionTime'], 'PSMarkSweepCount' => $jvmoverjmx_data['PSMarkSweepCollectionCount'], 'PSMarkSweepTime' => $jvmoverjmx_data['PSMarkSweepCollectionTime'], 'PSScavengeCount' => $jvmoverjmx_data['PSScavengeCollectionCount'], 'PSScavengeTime' => $jvmoverjmx_data['PSScavengeCollectionTime']);
        update_application($app_id, $data);
        rrdtool_update_ng($device, 'jvmoverjmx', $data, $app_id);
        unset($jvmoverjmx_data, $jmxdataValue);
    }
}
// EOF
예제 #26
0
<?php

/**
 * Observium Network Management and Monitoring System
 *
 * @package    observium
 * @subpackage poller
 * @author     Sander Steffann <*****@*****.**>
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
foreach ($agent_data['app']['dhcpkit'] as $collection => $collection_data) {
    $lines = explode("\n", $agent_data['app']['dhcpkit'][$collection]);
    $data = array();
    foreach ($lines as $line) {
        // Line format is "key:value"
        list($key, $value) = explode(':', $line, 2);
        // Adjust naming
        $key = preg_replace('/\\.information_request$/', '.inf_req', $key);
        $key = preg_replace('/^messages_(in|out)\\./', 'msg_$1_', $key);
        $data[$key] = intval($value);
    }
    $app_id = discover_app($device, 'dhcpkit', $collection);
    update_application($app_id, $data);
    rrdtool_update_ng($device, 'dhcpkit-stats', $data, $app_id);
    unset($lines);
    unset($data);
}
/* End of file dhcpkit.inc.php */
예제 #27
0
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
//<<<app-vmwaretools>>>
//vmtotalmem:2051
//vmswap:117
//vmballoon:1302
//vmmemres:256
//vmmemlimit:U
//vmspeed:2660000000
//vmcpulimit:U
//vmcpures:0
if (!empty($agent_data['app']['vmwaretools'])) {
    $app_id = discover_app($device, 'vmwaretools');
    // Parse the data, first try key:value format
    foreach (explode("\n", $agent_data['app']['vmwaretools']) as $line) {
        // Parse key:value line
        list($key, $value) = explode(':', $line, 2);
        $values[$key] = $value;
    }
    rrdtool_update_ng($device, 'vmwaretools', $values, $app_id);
    update_application($app_id, $values);
    unset($values, $app_id);
}
// EOF
예제 #28
0
if (is_numeric($fdb_count) && $fdb_count > 0) {
    rrdtool_update_ng($device, 'fdb_count', array('value' => $fdb_count));
    $graphs['fdb_count'] = TRUE;
} else {
    $graphs['fdb_count'] = FALSE;
}
// FIXME should non-global fdb count be in the ports poller?
$fdbcount_module = 'enable_ports_fdbcount';
if ($attribs[$fdbcount_module] || $config[$fdbcount_module] && !isset($attribs[$fdbcount_module])) {
    foreach ($fdb_portcount as $port => $count) {
        $port_info = $port_table[$port];
        if (!$port_info) {
            print_debug("No entry in port table for {$port}");
            continue;
        }
        rrdtool_update_ng($device, 'port-fdbcount', array('value' => $count), get_port_rrdindex($port_info));
        $graphs['port_fdb_count'] = TRUE;
    }
}
// print_cli_table($table_rows, array('%WVLAN%n', '%WMAC Address%n', '%WPort%n', '%WPort ID%n', '%WFDB Port%n', '%WifIndex%n', '%WStatus%n'));
// Loop the existing list and delete anything remaining
$table_rows = array();
foreach ($fdbs_db as $vlan => $fdb_macs) {
    foreach ($fdb_macs as $mac => $data) {
        $table_row = array();
        $table_row[] = $vlan;
        $table_row[] = $mac;
        //$table_row[] = $data['port_label_short'];
        $table_row[] = $data['port_id'];
        //$table_row[] = $fdb_port;
        //$table_row[] = $data['ifIndex'];
예제 #29
0
    foreach ($ports_poll as $id => $eigrp_port) {
        list($vpn, $as, $ifIndex) = explode('.', $id);
        echo "{$vpn} {$as} {$ifIndex}" . PHP_EOL;
        $port = get_port_by_index_cache($device['device_id'], $ifIndex);
        if (is_array($port_db[$vpn . '-' . $as . '-' . $ifIndex])) {
            $eigrp_update = NULL;
            if ($port['port_id'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['port_id']) {
                $eigrp_update['port_id'] = $port['port_id'];
            }
            if ($eigrp_port['cEigrpAuthMode'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['eigrp_authmode']) {
                $eigrp_update['eigrp_authmode'] = $eigrp_port['cEigrpAuthMode'];
            }
            if ($eigrp_port['cEigrpMeanSrtt'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['eigrp_MeanSrtt']) {
                $eigrp_update['eigrp_MeanSrtt'] = $eigrp_port['cEigrpMeanSrtt'];
            }
            if (is_array($eigrp_update)) {
                dbUpdate($eigrp_update, 'eigrp_ports', '`eigrp_port_id` = ?', array($port_db[$vpn . '-' . $as . '-' . $ifIndex]['eigrp_port_id']));
            }
            unset($eigrp_update);
        } else {
            dbInsert(array('eigrp_vpn' => $vpn, 'eigrp_as' => $as, 'eigrp_ifIndex' => $ifIndex, 'port_id' => $port['port_id'], 'device_id' => $device['device_id'], 'eigrp_peer_count' => $eigrp_port['cEigrpPeerCount']), 'eigrp_ports');
            echo '+';
        }
        // Write per-interface EIGRP statistics
        rrdtool_update_ng($device, 'cisco-eigrp', array('MeanSrtt' => $eigrp_port['cEigrpMeanSrtt'], 'UMcasts' => $eigrp_port['cEigrpUMcasts'], 'RMcasts' => $eigrp_port['cEigrpRMcasts'], 'UUcasts' => $eigrp_port['cEigrpUUcasts'], 'RUcasts' => $eigrp_port['cEigrpRUcasts'], 'McastExcepts' => $eigrp_port['cEigrpMcastExcepts'], 'CRpkts' => $eigrp_port['cEigrpCRpkts'], 'AcksSuppressed' => $eigrp_port['cEigrpAcksSuppressed'], 'RetransSent' => $eigrp_port['cEigrpRetransSent'], 'OOSrvcd' => $eigrp_port['cEigrpOOSrvcd']), "{$vpn}-{$as}-{$ifIndex}");
        echo PHP_EOL;
        unset($eigrp_update);
    }
}
// End if CISCO-EIGRP-MIB
// EOF
예제 #30
0
    }
    foreach ($cm_stats as $policy_index => $policy_entry) {
        foreach ($policy_entry as $object_index => $object_entry) {
            $port = get_port_by_ifIndex($device['device_id'], $service_policies[$policy_index]['cbQosIfIndex']);
            $object_entry['port_id'] = $port['port_id'];
            $object_entry['direction'] = $service_policies[$policy_index]['cbQosPolicyDirection'];
            $object_entry['policy_index'] = $policy_index;
            $object_entry['object_index'] = $object_index;
            $object_entry['cm_cfg_index'] = $object_indexes[$policy_index][$object_index]['cbQosConfigIndex'];
            $object_entry['pm_cfg_index'] = $object_indexes[$policy_index][$policy_index]['cbQosConfigIndex'];
            if (!is_numeric($object_entry['pm_cfg_index'])) {
                $object_entry['pm_cfg_index'] = $object_indexes[$policy_index]['1']['cbQosConfigIndex'];
            }
            $object_entry['policy_name'] = $policy_maps[$object_entry['pm_cfg_index']]['cbQosPolicyMapName'];
            $object_entry['policy_desc'] = $policy_maps[$object_entry['pm_cfg_index']]['cbQosPolicyMapDesc'];
            $object_entry['cm_name'] = $class_maps[$object_entry['cm_cfg_index']]['cbQosCMName'];
            $object_entry['cm_desc'] = $class_maps[$object_entry['cm_cfg_index']]['cbQosCMDesc'];
            $object_entry['cm_info'] = $class_maps[$object_entry['cm_cfg_index']]['cbQosCMInfo'];
            #print_r($object_entry);
            if (!isset($cbq_table[$policy_index][$object_index])) {
                dbInsert(array('device_id' => $device['device_id'], 'port_id' => $port['port_id'], 'policy_index' => $policy_index, 'object_index' => $object_index, 'direction' => $object_entry['direction']), 'ports_cbqos');
                echo "+";
                $cbq_table[$policy_index][$object_index] = dbFetchRow("SELECT * FROM `ports_cbqos` WHERE `device_id` = ? AND `port_id` = ? AND `policy_index` = ? AND `object_index` = ?", array($device['device_id'], $port['port_id'], $policy_index, $object_index));
            }
            // Do the RRD thing!
            rrdtool_update_ng($device, 'cisco-cbqos', array('PrePolicyPkt' => $object_entry['cbQosCMPrePolicyPkt64'], 'PrePolicyByte' => $object_entry['cbQosCMPrePolicyByte64'], 'PostPolicyByte' => $object_entry['cbQosCMPostPolicyByte64'], 'DropPkt' => $object_entry['cbQosCMDropPkt64'], 'DropByte' => $object_entry['cbQosCMDropByte64'], 'NoBufDropPkt' => $object_entry['cbQosCMNoBufDropPkt64']), "{$policy_index}-{$object_index}");
        }
    }
}
// End check if QoS is enabled before we walk everything
// EOF