updates et al

git-svn-id: http://www.observium.org/svn/observer/trunk@503 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-11-07 02:30:38 +00:00
parent 65b8eb183e
commit 975c3a2a93
28 changed files with 303 additions and 303 deletions
+9 -2
View File
@@ -41,10 +41,17 @@ if($_GET['debug']) {
$graphfile = $config['temp_dir'] . "/" . strgen() . ".png";
$os = gethostosbyid($device_id);
$os_lower = strtolower($os);
if($os_groups[$os_lower]) {$os_group = $os_groups[$os_lower];}
if(is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".strtolower($os).".inc.php")) {
include($config['install_dir'] . "/html/includes/graphs/".$type."_".strtolower($os).".inc.php");
if(is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_lower.".inc.php")) {
/// Type + OS Specific
include($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_lower.".inc.php");
}elseif($os_group && is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_group.".inc.php")) {
/// Type + OS Group Specific
include($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_group.".inc.php");
} elseif(is_file($config['install_dir'] . "/html/includes/graphs/$type.inc.php")) {
/// Type Specific
include($config['install_dir'] . "/html/includes/graphs/$type.inc.php");
}
+2
View File
@@ -1,5 +1,7 @@
<?php
$scale_min = "0";
$data = mysql_fetch_array(mysql_query("SELECT * FROM bgpPeers AS B, devices AS D WHERE bgpPeer_id = '".$_GET['peer']."' AND D.device_id = B.device_id"));
$rrd_filename = $config['rrd_dir'] . "/" . $data['hostname'] . "/bgp-" . $data['bgpPeerIdentifier'] . ".rrd";
@@ -1,5 +1,9 @@
<?php
include("common.inc.php");
$scale_min = "0";
$data = mysql_fetch_array(mysql_query("SELECT * FROM bgpPeers AS B, devices AS D WHERE bgpPeer_id = '".$_GET['peer']."' AND D.device_id = B.device_id"));
$rrd_filename = $config['rrd_dir'] . "/" . $data['hostname'] . "/cbgp-" . $data['bgpPeerIdentifier'] . ".".$_GET['afi'].".".$_GET['safi'].".rrd";
-5
View File
@@ -1,9 +1,4 @@
<?php
$os = strtolower($os);
if($os == "linux" || $os == "netbsd" || $os == "freebsd" || $os == "dragonfly" || $os == "openbsd" || $os == "windows" || $os == "m0n0wall" || $os == "Voswall" || $os == "pfsense" || $os == "dragonfly" || $os == "openbsd") {
include("device_cpu_unix.inc.php");
}
?>
@@ -4,7 +4,7 @@ $scale_min = "0";
include("common.inc.php");
$database = $config['rrd_dir'] . "/" . $hostname . "/sys.rrd";
$database = $config['rrd_dir'] . "/" . $hostname . "/hrSystem.rrd";
$rrd_options .= " DEF:procs=$database:procs:AVERAGE";
$rrd_options .= " COMMENT:Processes\ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n";
@@ -1,5 +1,8 @@
<?php
$scale_min = "0";
$scale_max = "100";
include("common.inc.php");
$iter = "1";
@@ -13,7 +16,7 @@ include("common.inc.php");
$descr = str_pad($fs[hrStorageDescr], 14);
$descr = substr($descr,0,14);
$text = str_replace("/", "_", $fs['hrStorageDescr']);
$rrd = $config['rrd_dir'] . "/$hostname/storage-$text.rrd";
$rrd = $config['rrd_dir'] . "/$hostname/hrStorage-".$fs['hrStorageIndex'].".rrd";
$rrd_options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
$rrd_options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
$rrd_options .= " DEF:$fs[storage_id]p=$rrd:perc:AVERAGE";
@@ -4,7 +4,7 @@ $scale_min = "0";
include("common.inc.php");
$database = $config['rrd_dir'] . "/" . $hostname . "/sys.rrd";
$database = $config['rrd_dir'] . "/" . $hostname . "/hrSystem.rrd";
$rrd_options .= " DEF:users=$database:users:AVERAGE";
$rrd_options .= " DEF:users_max=$database:users:MAX";
@@ -4,50 +4,64 @@ include('common.inc.php');
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/netstats-icmp.rrd";
$rrd_options .= " DEF:sqIn=$rrd_filename:icmpInSrcQuenchs:AVERAGE";
$rrd_options .= " DEF:sqOut=$rrd_filename:icmpOutSrcQuenchs:AVERAGE";
$rrd_options .= " DEF:redirIn=$rrd_filename:icmpInRedirects:AVERAGE";
$rrd_options .= " DEF:redirOut=$rrd_filename:icmpOutRedirects:AVERAGE";
$rrd_options .= " DEF:maskIn=$rrd_filename:icmpInAddrMasks:AVERAGE";
$rrd_options .= " DEF:maskOut=$rrd_filename:icmpOutAddrMasks:AVERAGE";
$rrd_options .= " DEF:maskrepIn=$rrd_filename:icmpInAddrMaskReps:AVERAGE";
$rrd_options .= " DEF:maskrepOut=$rrd_filename:icmpOutAddrMaskReps:AVERAGE";
$rrd_options .= " CDEF:sqOutInv=sqOut,-1,*";
$rrd_options .= " CDEF:redirOutInv=redirOut,-1,*";
$rrd_options .= " CDEF:maskOutInv=maskOut,-1,*";
$rrd_options .= " CDEF:maskrepOutInv=maskrepOut,-1,*";
$rrd_options .= " AREA:sqIn#00ff00:'Source Quenches In '";
$rrd_options .= " GPRINT:sqIn:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:sqIn:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:sqIn:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:redirIn#0000ff:'Redirects In '";
$rrd_options .= " GPRINT:redirIn:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:redirIn:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:redirIn:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:maskIn#ff00b4:'Mask Requests In '";
$rrd_options .= " GPRINT:maskIn:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskIn:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskIn:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:maskrepIn#00ff72:'Mask Replies In '";
$rrd_options .= " GPRINT:maskrepIn:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskrepIn:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskrepIn:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " COMMENT:'\\n'";
$rrd_options .= " AREA:sqOut#00ff00:'Source Quenches Out'";
$rrd_options .= " GPRINT:sqOut:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:sqOut:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:sqOut:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:redirOut#0000ff:'Redirects Out '";
$rrd_options .= " GPRINT:redirOut:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:redirOut:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:redirOut:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:maskOut#ff00b4:'Mask Requests Out '";
$rrd_options .= " GPRINT:maskOut:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskOut:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskOut:MAX:'Max \\: %8.2lf %s\\n'";
$rrd_options .= " STACK:maskrepOut#00ff72:'Mask Replies Out '";
$rrd_options .= " GPRINT:maskrepOut:AVERAGE:'Avg \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskrepOut:MIN:'Min \\: %8.2lf %s'";
$rrd_options .= " GPRINT:maskrepOut:MAX:'Max \\: %8.2lf %s'";
$rrd_options .= " DEF:InSrcQuenchs=$rrd_filename:icmpInSrcQuenchs:AVERAGE";
$rrd_options .= " DEF:OutSrcQuenchs=$rrd_filename:icmpOutSrcQuenchs:AVERAGE";
$rrd_options .= " DEF:InRedirects=$rrd_filename:icmpInRedirects:AVERAGE";
$rrd_options .= " DEF:OutRedirects=$rrd_filename:icmpOutRedirects:AVERAGE";
$rrd_options .= " DEF:InAddrMasks=$rrd_filename:icmpInAddrMasks:AVERAGE";
$rrd_options .= " DEF:OutAddrMasks=$rrd_filename:icmpOutAddrMasks:AVERAGE";
$rrd_options .= " DEF:InAddrMaskReps=$rrd_filename:icmpInAddrMaskReps:AVERAGE";
$rrd_options .= " DEF:OutAddrMaskReps=$rrd_filename:icmpOutAddrMaskReps:AVERAGE";
$rrd_options .= " DEF:InSrcQuenchs_m=$rrd_filename:icmpInSrcQuenchs:MAX";
$rrd_options .= " DEF:OutSrcQuenchs_m=$rrd_filename:icmpOutSrcQuenchs:MAX";
$rrd_options .= " DEF:InRedirects_m=$rrd_filename:icmpInRedirects:MAX";
$rrd_options .= " DEF:OutRedirects_m=$rrd_filename:icmpOutRedirects:MAX";
$rrd_options .= " DEF:InAddrMasks_m=$rrd_filename:icmpInAddrMasks:MAX";
$rrd_options .= " DEF:OutAddrMasks_m=$rrd_filename:icmpOutAddrMasks:MAX";
$rrd_options .= " DEF:InAddrMaskReps_m=$rrd_filename:icmpInAddrMaskReps:MAX";
$rrd_options .= " DEF:OutAddrMaskReps_m=$rrd_filename:icmpOutAddrMaskReps:MAX";
$rrd_options .= " CDEF:OutSrcQuenchs_Inv=OutSrcQuenchs,-1,*";
$rrd_options .= " CDEF:OutRedirects_Inv=OutRedirects,-1,*";
$rrd_options .= " CDEF:OutAddrMasks_Inv=OutAddrMasks,-1,*";
$rrd_options .= " CDEF:OutAddrMaskReps_Inv=OutAddrMaskReps,-1,*";
$rrd_options .= " COMMENT:Packets/sec\ \ \ \ Current\ \ \ \ Average\ \ \ Maximum\\\\n";
$rrd_options .= " LINE1.25:InSrcQuenchs#00cc00:'InSrcQuenchs '";
$rrd_options .= " GPRINT:InSrcQuenchs:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:InSrcQuenchs:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:InSrcQuenchs_m:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:OutSrcQuenchs_Inv#006600:'OutSrcQuenchs '";
$rrd_options .= " GPRINT:OutSrcQuenchs:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:OutSrcQuenchs:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:OutSrcQuenchs_m:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:InRedirects#cc0000:'InRedirects '";
$rrd_options .= " GPRINT:InRedirects:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:InRedirects:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:InRedirects_m:MAX:'%6.2lf%s\\n'";
$rrd_options .= " LINE1.25:OutRedirects_Inv#660000:'OutRedirects '";
$rrd_options .= " GPRINT:OutRedirects:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:OutRedirects:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:OutRedirects_m:MAX:'%6.2lf%s\\n'";
$rrd_options .= " LINE1.25:InAddrMasks#0066cc:'InAddrMasks '";
$rrd_options .= " GPRINT:InAddrMasks:LAST:'%6.2lf%s'";
$rrd_options .= " GPRINT:InAddrMasks:AVERAGE:'%6.2lf%s'";
$rrd_options .= " GPRINT:InAddrMasks:MAX:'%6.2lf%s\\n'";
$rrd_options .= " LINE1.25:OutAddrMasks_Inv#003399:'OutAddrMasks '";
$rrd_options .= " GPRINT:OutAddrMasks:LAST:'%6.2lf%s'";
$rrd_options .= " GPRINT:OutAddrMasks:AVERAGE:'%6.2lf%s'";
$rrd_options .= " GPRINT:OutAddrMasks_m:MAX:'%6.2lf%s\\n'";
$rrd_options .= " LINE1.25:InAddrMaskReps#cc00cc:'InAddrMaskReps '";
$rrd_options .= " GPRINT:InAddrMaskReps:LAST:'%6.2lf%s'";
$rrd_options .= " GPRINT:InAddrMaskReps:AVERAGE:'%6.2lf%s'";
$rrd_options .= " GPRINT:InAddrMaskReps:MAX:'%6.2lf%s\\n'";
$rrd_options .= " LINE1.25:OutAddrMaskReps_Inv#990099:'OutAddrMaskReps'";
$rrd_options .= " GPRINT:OutAddrMaskReps:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:OutAddrMaskReps:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:OutAddrMaskReps_m:MAX:%6.2lf%s\\\\n";
?>
@@ -30,22 +30,37 @@ $rrd_options .= " CDEF:MReasmFails=MipReasmFails,ipInDelivers,/,100,*";
$rrd_options .= " CDEF:MFragOKs=MipFragOKs,ipInDelivers,/,100,*";
$rrd_options .= " CDEF:MFragFails=MipFragFails,ipInDelivers,/,100,*";
$rrd_options .= " CDEF:MFragCreates=MipFragCreates,ipInDelivers,/,100,*";
$rrd_options .= " LINE1:FragOKs#00ff00:'Fragmentation OK'";
$rrd_options .= " LINE2:FragFails#ff0000:'Fragmentation Fail'";
$rrd_options .= " LINE1:ReasmOKs#0033aa:'Reassembly OK'";
$rrd_options .= " LINE2:ReasmFails#000000:'Reassembly Fail'";
$rrd_options .= " GPRINT:ReasmReqds:AVERAGE:Avg\ ReasmReqd\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MReasmReqds:MAX:Max\ ReasmReqd\ %1.2lf\ %%";
$rrd_options .= " GPRINT:ReasmOKs:AVERAGE:Avg\ ReasmOK\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MReasmOKs:MAX:Max\ ReasmOK\ %1.2lf\ %%";
$rrd_options .= " GPRINT:ReasmFails:AVERAGE:Avg\ ReasmFail\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MReasmFails:MAX:Max\ ReasmFail\ %1.2lf\ %%";
$rrd_options .= " GPRINT:FragOKs:AVERAGE:Avg\ FragOK\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MFragOKs:MAX:Max\ FragOK\ %1.2lf\ %%";
$rrd_options .= " GPRINT:FragFails:AVERAGE:Avg\ FragFail\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MFragFails:MAX:Max\ FragFail\ %1.2lf\ %%";
$rrd_options .= " GPRINT:FragCreates:AVERAGE:Avg\ FragCreate\ %1.2lf\ %%";
$rrd_options .= " GPRINT:MFragCreates:MAX:Max\ FragCreate\ %1.2lf\ %%";
$rrd_options .= " COMMENT:' Calculated as a % of ipInDelivers'"
$rrd_options .= " COMMENT:'% ipInDelivers Current Average Maximum\\n'";
$rrd_options .= " LINE1.25:FragOKs#00cc00:'Frag OK '";
$rrd_options .= " GPRINT:FragOKs:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:FragOKs:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MFragOKs:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:FragFails#cc0000:'Frag Fail '";
$rrd_options .= " GPRINT:FragFails:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:FragFails:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MFragFails:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:ReasmOKs#006600:'Reasm OK '";
$rrd_options .= " GPRINT:ReasmOKs:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:ReasmOKs:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MReasmOKs:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:ReasmFails#660000:'Reasm Fail '";
$rrd_options .= " GPRINT:ReasmFails:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:ReasmFails:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MReasmFails:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:FragCreates#00cc:'Frag Create '";
$rrd_options .= " GPRINT:FragCreates:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:FragCreates:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MFragCreates:MAX:%6.2lf%s\\\\n";
$rrd_options .= " LINE1.25:ReasmReqds#000066:'Reasm Reqd '";
$rrd_options .= " GPRINT:ReasmReqds:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:ReasmReqds:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:MReasmReqds:MAX:%6.2lf%s\\\\n";
?>
+22 -22
View File
@@ -2,29 +2,29 @@
include("common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/" . $_GET['device'] . "/uptime.rrd";
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/load.rrd";
$options .= " DEF:1min=$rrd_filename:1min:AVERAGE";
$options .= " DEF:5min=$rrd_filename:5min:AVERAGE";
$options .= " DEF:15min=$rrd_filename:15min:AVERAGE";
$options .= " CDEF:a=1min,100,/";
$options .= " CDEF:b=5min,100,/";
$options .= " CDEF:c=15min,100,/";
$options .= " CDEF:cdefd=a,b,c,+,+";
$options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
$options .= " AREA:a#ffeeaa:1\ Min:";
$options .= " LINE1:a#c5aa00:";
$options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf";
$options .= " GPRINT:a:AVERAGE:\ \ %7.2lf";
$options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n";
$options .= " LINE1.25:b#ea8f00:5\ Min:";
$options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf";
$options .= " GPRINT:b:AVERAGE:\ \ %7.2lf";
$options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n";
$options .= " LINE1.25:c#cc0000:15\ Min";
$options .= " GPRINT:c:LAST:\ \ \ %7.2lf";
$options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
$options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
$rrd_options .= " DEF:1min=$rrd_filename:1min:AVERAGE";
$rrd_options .= " DEF:5min=$rrd_filename:5min:AVERAGE";
$rrd_options .= " DEF:15min=$rrd_filename:15min:AVERAGE";
$rrd_options .= " CDEF:a=1min,100,/";
$rrd_options .= " CDEF:b=5min,100,/";
$rrd_options .= " CDEF:c=15min,100,/";
$rrd_options .= " CDEF:cdefd=a,b,c,+,+";
$rrd_options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
$rrd_options .= " AREA:a#ffeeaa:1\ Min:";
$rrd_options .= " LINE1:a#c5aa00:";
$rrd_options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf";
$rrd_options .= " GPRINT:a:AVERAGE:\ \ %7.2lf";
$rrd_options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n";
$rrd_options .= " LINE1.25:b#ea8f00:5\ Min:";
$rrd_options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf";
$rrd_options .= " GPRINT:b:AVERAGE:\ \ %7.2lf";
$rrd_options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n";
$rrd_options .= " LINE1.25:c#cc0000:15\ Min";
$rrd_options .= " GPRINT:c:LAST:\ \ \ %7.2lf";
$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
?>
@@ -1,9 +1,4 @@
<?php
$os = strtolower($os);
if($os == "linux" || $os == "netbsd" || $os == "freebsd" || $os == "dragonfly" || $os == "openbsd" || $os == "windows" || $os == "m0n0wall" || $os == "Voswall" || $os == "pfsense" || $os == "dragonfly" || $os == "openbsd") {
include("device_memory_unix.inc.php");
}
?>
+11 -7
View File
@@ -5,7 +5,7 @@ include("common.inc.php");
$rrd_options .= " -l 0 -E -b 1024 -u 100 -r";
$iter = "1";
$rrd_options .= " COMMENT:' Cur Max\\n'";
$rrd_options .= " COMMENT:' Currently Used Max\\n'";
$sql = mysql_query("SELECT * FROM `cempMemPool` where `device_id` = '$device_id'");
while($mempool = mysql_fetch_array($sql)) {
@@ -18,16 +18,20 @@ include("common.inc.php");
$mempool['descr_fixed'] = str_replace("Routing Processor", "RP", $mempool['descr_fixed']);
$mempool['descr_fixed'] = str_replace("Switching Processor", "SP", $mempool['descr_fixed']);
$mempool['descr_fixed'] = str_replace("Processor", "Proc", $mempool['descr_fixed']);
$mempool['descr_fixed'] = str_pad($mempool['descr_fixed'], 28);
$mempool['descr_fixed'] = substr($mempool['descr_fixed'],0,28);
$mempool['descr_fixed'] = str_pad($mempool['descr_fixed'], 20);
$mempool['descr_fixed'] = substr($mempool['descr_fixed'],0,20);
$oid = $mempool['entPhysicalIndex'] . "." . $mempool['Index'];
$rrd = $config['rrd_dir'] . "/$hostname/cempMemPool-$oid.rrd";
$rrd_options .= " DEF:mempool" . $iter . "free=$rrd:free:AVERAGE ";
$rrd_options .= " DEF:mempool" . $iter . "used=$rrd:used:AVERAGE ";
$rrd_options .= " DEF:mempool" . $iter . "free=$rrd:free:AVERAGE";
$rrd_options .= " DEF:mempool" . $iter . "used=$rrd:used:AVERAGE";
$rrd_options .= " DEF:mempool" . $iter . "free_m=$rrd:free:MAX";
$rrd_options .= " DEF:mempool" . $iter . "used_m=$rrd:used:MAX";
$rrd_options .= " CDEF:mempool" . $iter . "total=mempool" . $iter . "used,mempool" . $iter . "used,mempool" . $iter . "free,+,/,100,* ";
$rrd_options .= " LINE1:mempool" . $iter . "total#" . $colour . ":'" . $mempool['descr_fixed'] . "' ";
$rrd_options .= " GPRINT:mempool" . $iter . "total:LAST:%3.0lf";
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf\\\l ";
$rrd_options .= " GPRINT:mempool" . $iter . "used:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:mempool" . $iter . "total:LAST:%3.0lf%%";
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf%%\\\\n";
$iter++;
}
+7 -3
View File
@@ -1,8 +1,14 @@
<?php
$scale_min = "0";
include("common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/uptime.rrd";
if (is_file($config['rrd_dir'] . "/" . $hostname . "/hrSystem.rrd")) {
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/hrSystem.rrd";
} else {
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/uptime.rrd";
}
$rrd_options .= " DEF:uptime=$rrd_filename:uptime:AVERAGE";
$rrd_options .= " CDEF:cuptime=uptime,86400,/";
@@ -12,6 +18,4 @@ $rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/uptime.rrd";
$rrd_options .= " GPRINT:cuptime:LAST:%6.2lf\ GPRINT:cuptime:AVERAGE:%6.2lf\ ";
$rrd_options .= " GPRINT:cuptime:MAX:%6.2lf\ GPRINT:cuptime:AVERAGE:%6.2lf\\\\n";
$scale_min = "0";
?>
@@ -17,7 +17,7 @@ $rrd_options .= " -b 1024";
$descr = str_pad($fs[hrStorageDescr], 12);
$descr = substr($descr,0,12);
$text = str_replace("/", "_", $fs['hrStorageDescr']);
$rrd = $config['rrd_dir'] . "/$hostname/storage-$text.rrd";
$rrd = $config['rrd_dir'] . "/$hostname/hrStorage-".$fs['hrStorageIndex'].".rrd";
$rrd_options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
$rrd_options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
$rrd_options .= " DEF:$fs[storage_id]p=$rrd:perc:AVERAGE";
+35 -12
View File
@@ -84,18 +84,41 @@ while($device = mysql_fetch_array($device_query)) {
break;
case "Windows":
echo("<div class=graphhead>CPU Usage</div>");
$graph_type = "device_cpu";
include ("includes/print-device-graph.php");
$memgraph = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem.png", $day, $now, 335, 100);
$loadgraph = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load.png", $day, $now, 335, 100);
$cpugraphm = cpugraphWin ($device[hostname] . "-cpu.rrd", $device[hostname] . "-cpu-m.png", $month, $now, 335, 100);
$memgraphm = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem-m.png", $month, $now, 335, 100);
$loadgraphm = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load-m.png", $month, $now, 335, 100);
$usersgraph = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users.png", $day, $now, 335, 100);
$usersgraphm = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users-m.png", $month, $now, 335, 100);
$procsgraph = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs.png", $day, $now, 335, 100);
$procsgraphm = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs-m.png", $month, $now, 335, 100);
echo("<div class=graphhead>Memory Utilisation</div>");
$graph_type = "device_memory"; include ("includes/print-device-graph.php");
echo("<br />");
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
echo("<div class=graphhead>Storage</div>");
$graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
echo("<br />");
}
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
echo("<div class=graphhead>Temperatures</div>");
$graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
echo("<br />");
}
include("graphs/netstats.inc.php");
include("graphs/uptime.inc.php");
# $memgraph = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem.png", $day, $now, 335, 100);
# $loadgraph = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load.png", $day, $now, 335, 100);
# $cpugraphm = cpugraphWin ($device[hostname] . "-cpu.rrd", $device[hostname] . "-cpu-m.png", $month, $now, 335, 100);
# $memgraphm = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem-m.png", $month, $now, 335, 100);
# $loadgraphm = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load-m.png", $month, $now, 335, 100);
# $usersgraph = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users.png", $day, $now, 335, 100);
# $usersgraphm = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users-m.png", $month, $now, 335, 100);
# $procsgraph = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs.png", $day, $now, 335, 100);
# $procsgraphm = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs-m.png", $month, $now, 335, 100);
break;
case "FreeBSD":
case "NetBSD":
@@ -124,7 +147,7 @@ while($device = mysql_fetch_array($device_query)) {
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
echo("<div class=graphhead>Storage</div>");
$graph_type = "device_unixfs"; include ("includes/print-device-graph.php");
$graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
echo("<br />");
}
@@ -141,10 +164,10 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "device_load"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>Users Logged On</div>");
$graph_type = "device_users"; include ("includes/print-device-graph.php");
$graph_type = "device_hrusers"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>Running Processes</div>");
$graph_type = "device_processes"; include ("includes/print-device-graph.php");
$graph_type = "device_hrprocesses"; include ("includes/print-device-graph.php");
echo("<br />");
break;
@@ -3,6 +3,9 @@
echo("<div class=graphhead>IP Statistics</div>");
$graph_type = "device_ip"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>IP Fragmented Statistics</div>");
$graph_type = "device_ip_fragmented"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>TCP Statistics</div>");
$graph_type = "device_tcp"; include ("includes/print-device-graph.php");
echo("<br />");
@@ -12,6 +15,9 @@
echo("<div class=graphhead>ICMP Statistics</div>");
$graph_type = "device_icmp"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ICMP Informational Statistics</div>");
$graph_type = "device_icmp_informational"; include ("includes/print-device-graph.php");
echo("<br />");
?>
-1
View File
@@ -1,5 +1,4 @@
<?php
#include("group-collectd.inc.php");
?>
+3 -4
View File
@@ -29,7 +29,7 @@ while($drive = mysql_fetch_array($query)) {
$fs_url = "?page=device&id=".$device['device_id']."&section=dev-storage";
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr'];
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=unixfs&from=$month&to=$now&width=400&height=125\'>";
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=hrstorage&from=$month&to=$now&width=400&height=125\'>";
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
$drv_colour = percent_colour($perc);
@@ -39,7 +39,7 @@ while($drive = mysql_fetch_array($query)) {
</td><td style='font-weight: bold; color: $drv_colour'>" . $perc . "%</td><td>" . $total . "</td><td>" . $used . "</td><td></td></tr>");
$graph_type = "unixfs";
$graph_type = "hrstorage";
// start temperature graphs
@@ -73,7 +73,6 @@ while($drive = mysql_fetch_array($query)) {
}
echo("</table>");
echo("</table>");
?>
+2 -2
View File
@@ -118,10 +118,10 @@ echo("<a onmouseover=\"return overlib('<img src=\'graph.php?type=bits&if=36".
echo("<div style='clear: both; margin-top: 10px;'></div>");
echo("<a onmouseover=\"return overlib('<img src=\'graph.php?type=unixfs&id=54".
echo("<a onmouseover=\"return overlib('<img src=\'graph.php?type=hrstorage&id=54".
"&from=".$day."&to=".$now."&width=400&height=150\'>', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 18px; font-weight: bold;'>Alpha Storage</div>".
"<img src='graph.php?type=unixfs&id=54".
"<img src='graph.php?type=hrstorage&id=54".
"&from=".$day."&to=".$now."&width=200&height=100'></a>");
#}
+2 -2
View File
@@ -1,4 +1,4 @@
<?php
\<?php
if($_SESSION['userlevel'] >= '5') {
$sql = "SELECT * FROM `storage` AS S, `devices` AS D WHERE S.host_id = D.device_id ORDER BY D.hostname, S.hrStorageDescr";
@@ -33,7 +33,7 @@ while($drive = mysql_fetch_array($query)) {
$total = formatStorage($total);
$used = formatStorage($used);
$store_url = "graph.php?id=" . $drive['storage_id'] . "&type=unixfs&from=$month&to=$now&width=400&height=125";
$store_url = "graph.php?id=" . $drive['storage_id'] . "&type=hrstorage&from=$month&to=$now&width=400&height=125";
$store_popup = "onmouseover=\"return overlib('<img src=\'$store_url\'>', LEFT);\" onmouseout=\"return nd();\"";
$drv_colour = percent_colour($perc);