mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
cleanups
git-svn-id: http://www.observium.org/svn/observer/trunk@237 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -13,7 +13,6 @@ include_once($config['install_dir'] . "/includes/ios.php");
|
||||
include_once($config['install_dir'] . "/includes/unix.php");
|
||||
include_once($config['install_dir'] . "/includes/windows.php");
|
||||
include_once($config['install_dir'] . "/includes/procurve.php");
|
||||
include_once($config['install_dir'] . "/includes/snom.php");
|
||||
include_once($config['install_dir'] . "/includes/graphing.php");
|
||||
include_once($config['install_dir'] . "/includes/print-functions.php");
|
||||
include_once($config['install_dir'] . "/includes/billing-functions.php");
|
||||
|
||||
+11
-29
@@ -2,43 +2,25 @@
|
||||
|
||||
include("snom-graphing.php");
|
||||
|
||||
function pollDeviceSNOM() {
|
||||
function pollDeviceSNOM($device) {
|
||||
|
||||
global $device;
|
||||
global $community;
|
||||
$snmpver = $device['snmpver'];
|
||||
$id = $device['device_id'];
|
||||
$hostname = $device['hostname'];
|
||||
$hardware = $device['hardware'];
|
||||
$version = $device['version'];
|
||||
$features = $device['features'];
|
||||
$location = $device['location'];
|
||||
global $config
|
||||
|
||||
$snmpdata = `snmpget -Ovq -$snmpver -c $community $hostname 1.3.6.1.2.1.7526.2.1.1 1.3.6.1.2.1.7526.2.1.2 1.3.6.1.2.1.7526.2.2.1 1.3.6.1.2.1.7526.2.2.2`;
|
||||
$snmpdatab = `snmpget -Oqv -$snmpver -c $community $hostname 1.3.6.1.2.1.7526.2.5 1.3.6.1.2.1.7526.2.6`;
|
||||
$snmpdata = shell_exec($config['snmpget'] . " -Ovq -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." 1.3.6.1.2.1.7526.2.1.1 1.3.6.1.2.1.7526.2.1.2 1.3.6.1.2.1.7526.2.2.1 1.3.6.1.2.1.7526.2.2.2");
|
||||
$snmpdatab = shell_exec($config['snmpget'] . " -Oqv -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." 1.3.6.1.2.1.7526.2.5 1.3.6.1.2.1.7526.2.6");
|
||||
list($rxbytes, $rxpkts, $txbytes, $txpkts) = explode("\n", $snmpdata);
|
||||
list($calls, $registrations) = explode("\n", $snmpdatab);
|
||||
$txbytes = 0 - $txbytes * 8;
|
||||
$rxbytes = 0 - $rxbytes * 8;
|
||||
echo("$rxbytes, $rxpkts, $txbytes, $txpkts, $calls, $registrations");
|
||||
|
||||
$rrdfile = "rrd/" . $hostname . "-data.rrd";
|
||||
$rrdfile = "rrd/" . $device['hostname'] . "-data.rrd";
|
||||
if(!is_file($rrdfile)) {
|
||||
$woo = `rrdtool create $rrdfile \
|
||||
DS:INOCTETS:COUNTER:600:U:100000000000 \
|
||||
DS:OUTOCTETS:COUNTER:600:U:10000000000 \
|
||||
DS:INPKTS:COUNTER:600:U:10000000000 \
|
||||
DS:OUTPKTS:COUNTER:600:U:10000000000 \
|
||||
DS:CALLS:COUNTER:600:U:10000000000 \
|
||||
DS:REGISTRATIONS:COUNTER:600:U:10000000000 \
|
||||
RRA:AVERAGE:0.5:1:600 \
|
||||
RRA:AVERAGE:0.5:6:700 \
|
||||
RRA:AVERAGE:0.5:24:775 \
|
||||
RRA:AVERAGE:0.5:288:797 \
|
||||
RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 \
|
||||
RRA:MAX:0.5:24:775 \
|
||||
RRA:MAX:0.5:288:797`;
|
||||
$woo = shell_exec($config['rrdtool'] . " create $rrdfile \
|
||||
DS:INOCTETS:COUNTER:600:U:100000000000 DS:OUTOCTETS:COUNTER:600:U:10000000000 \
|
||||
DS:INPKTS:COUNTER:600:U:10000000000 DS:OUTPKTS:COUNTER:600:U:10000000000 \
|
||||
DS:CALLS:COUNTER:600:U:10000000000 DS:REGISTRATIONS:COUNTER:600:U:10000000000 \
|
||||
RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 \
|
||||
RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797");
|
||||
}
|
||||
|
||||
$rrdupdate = "N:$rxbytes:$txbytes:$rxpkts:$rxbytes:$calls:$registrations";
|
||||
|
||||
Reference in New Issue
Block a user