3
3
* Copyright (C) <2002-2005> Javier Szyszlican <javier@szysz.com>
4
4
* This program is licensed under the GNU GPL, full terms in the LICENSE file
6
function poller_cisco_saagent_forwardjitter($options) {
8
if ( !is_array($GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]])) {
10
while ( !is_array($sumpossd) and $i++ <= 2 ) {
11
$sumpossd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.9",1);
12
$sumnegsd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.14",1);
13
$nrpossd =snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.8",1);
14
$nrnegsd =snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.13",1);
17
if ( is_array($sumpossd) )
18
foreach ( $sumpossd as $key=>$entry ) {
19
$key=explode(".",$key);
20
$key=$key[count($key)-1];
22
$sum_pos_sd[$key]=$entry;
25
if ( is_array($sumnegsd) )
26
foreach ( $sumnegsd as $key=>$entry ) {
27
$key=explode(".",$key);
28
$key=$key[count($key)-1];
30
$sum_neg_sd[$key]=$entry;
33
if ( is_array($nrpossd) )
34
foreach ( $nrpossd as $key=>$entry ) {
35
$key=explode(".",$key);
36
$key=$key[count($key)-1];
38
$nr_pos_sd[$key]=$entry;
41
if ( is_array($nrnegsd) )
42
foreach ( $nrnegsd as $key=>$entry ) {
43
$key=explode(".",$key);
44
$key=$key[count($key)-1];
46
$nr_neg_sd[$key]=$entry;
49
if ( is_array($sum_pos_sd) )
50
foreach ( $sum_pos_sd as $key=>$entry ) {
51
$sum=$sum_pos_sd[$key]+$sum_neg_sd[$key];
52
$nr=$nr_pos_sd[$key]+$nr_neg_sd[$key];
54
$forward_jitter[$key]=0;
56
$forward_jitter[$key]=($sum/$nr);
58
$GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$key]=$forward_jitter[$key];
63
if ( isset($GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$options["index"]]) )
64
$value=$GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$options["index"]];
66
return round($value,2);
6
function poller_cisco_saagent_forwardjitter($options)
8
if (empty($options['ro_community']) or !is_numeric($options['index']))
10
$sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1';
11
$ip = $options['host_ip'];
12
$comm = $options['ro_community'];
13
$inst = $options['index'];
15
if ( ($sumpossd = snmp_get($ip, $comm, "$sa_oid.9.$inst")) === FALSE)
17
if ( ($sumnegsd = snmp_get($ip, $comm, "$sa_oid.14.$inst")) === FALSE)
19
if ( ($nrpossd = snmp_get($ip, $comm, "$sa_oid.8.$inst")) === FALSE)
21
if ( ($nrnegsd = snmp_get($ip, $comm, "$sa_oid.13.$inst")) === FALSE)
24
$sum = $sumpossd + $sumnegsd;
25
$nr = $nrpostsd + $nrnegsd;
29
$jitter = round($sum / $nr,2);