2009-11-09 11:38:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/// HOST-RESOURCES-MIB
|
|
|
|
// Generic System Statistics
|
|
|
|
|
2010-07-28 12:59:59 +00:00
|
|
|
$oid_list = "hrSystemProcesses.0 hrSystemNumUsers.0";
|
|
|
|
$hrSystem = snmp_get_multi ($device, $oid_list, "-OUQs", "HOST-RESOURCES-MIB");
|
|
|
|
|
2010-07-28 19:43:02 +00:00
|
|
|
echo("HR Stats:");
|
|
|
|
|
2011-03-16 01:11:27 +00:00
|
|
|
if (is_numeric($hrSystem[0]['hrSystemProcesses']))
|
2010-07-28 12:59:59 +00:00
|
|
|
{
|
2010-07-28 19:43:02 +00:00
|
|
|
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd";
|
2011-03-16 01:11:27 +00:00
|
|
|
if (!is_file($rrd_file))
|
|
|
|
{
|
2011-03-10 15:51:56 +00:00
|
|
|
rrdtool_create($rrd_file,"--step 300 \
|
2009-11-09 11:38:13 +00:00
|
|
|
DS:procs:GAUGE:600:0:U \
|
|
|
|
RRA:AVERAGE:0.5:1:800 \
|
|
|
|
RRA:AVERAGE:0.5:6:800 \
|
|
|
|
RRA:AVERAGE:0.5:24:800 \
|
|
|
|
RRA:AVERAGE:0.5:288:800 \
|
|
|
|
RRA:MAX:0.5:1:800 \
|
|
|
|
RRA:MAX:0.5:6:800 \
|
|
|
|
RRA:MAX:0.5:24:800 \
|
|
|
|
RRA:MAX:0.5:288:800");
|
2010-07-28 12:59:59 +00:00
|
|
|
}
|
2011-03-16 17:57:40 +00:00
|
|
|
|
2010-07-28 19:43:02 +00:00
|
|
|
rrdtool_update($rrd_file, "N:".$hrSystem[0]['hrSystemProcesses']);
|
|
|
|
$graphs['hr_processes'] = TRUE;
|
|
|
|
echo(" Processes");
|
2009-11-09 11:38:13 +00:00
|
|
|
}
|
|
|
|
|
2011-03-16 01:11:27 +00:00
|
|
|
if (is_numeric($hrSystem[0]['hrSystemNumUsers']))
|
2010-07-28 12:59:59 +00:00
|
|
|
{
|
2010-07-28 19:43:02 +00:00
|
|
|
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd";
|
2011-03-16 01:11:27 +00:00
|
|
|
if (!is_file($rrd_file))
|
|
|
|
{
|
2011-03-10 15:51:56 +00:00
|
|
|
rrdtool_create($rrd_file, "--step 300 \
|
2010-07-28 12:59:59 +00:00
|
|
|
DS:users:GAUGE:600:0:U \
|
|
|
|
RRA:AVERAGE:0.5:1:800 \
|
|
|
|
RRA:AVERAGE:0.5:6:800 \
|
|
|
|
RRA:AVERAGE:0.5:24:800 \
|
|
|
|
RRA:AVERAGE:0.5:288:800 \
|
|
|
|
RRA:MAX:0.5:1:800 \
|
|
|
|
RRA:MAX:0.5:6:800 \
|
|
|
|
RRA:MAX:0.5:24:800 \
|
|
|
|
RRA:MAX:0.5:288:800");
|
|
|
|
}
|
2011-03-16 17:57:40 +00:00
|
|
|
|
2010-07-28 19:43:02 +00:00
|
|
|
rrdtool_update($rrd_file, "N:".$hrSystem[0]['hrSystemNumUsers']);
|
|
|
|
$graphs['hr_users'] = TRUE;
|
|
|
|
echo(" Users");
|
2010-07-28 12:59:59 +00:00
|
|
|
}
|
2009-11-09 11:38:13 +00:00
|
|
|
|
2010-07-28 19:43:02 +00:00
|
|
|
echo("\n");
|
2009-11-09 11:38:13 +00:00
|
|
|
|
2011-03-16 01:11:27 +00:00
|
|
|
?>
|