mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
update rrd locations
git-svn-id: http://www.observium.org/svn/observer/trunk@139 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -72,31 +72,31 @@
|
||||
$graph = unixfsgraph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'calls':
|
||||
$graph = callsgraphSNOM ($hostname . "-data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'ip_graph':
|
||||
$graph = ip_graph ($hostname . "-netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = ip_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'icmp_graph':
|
||||
$graph = icmp_graph ($hostname . "-netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = icmp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'tcp_graph':
|
||||
$graph = tcp_graph ($hostname . "-netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = tcp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'udp_graph':
|
||||
$graph = udp_graph ($hostname . "-netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = udp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'cpu':
|
||||
if($os == "Linux" || $os == "NetBSD" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "Windows" || $os == "m0n0wall" || $os == "Voswall" || $os == "pfSense" || $os == "DragonFly" || $os == "OpenBSD") {
|
||||
$graph = cpugraphUnix ($hostname . "-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = cpugraphUnix ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "IOS") {
|
||||
$graph = cpugraph ($hostname . "-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = cpugraph ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Windows") {
|
||||
$graph = cpugraphwin ($hostname . "-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = cpugraphwin ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "ProCurve") {
|
||||
$graph = cpugraphHP ($hostname . "-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = cpugraphHP ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Snom") {
|
||||
$graph = callsgraphSNOM ($hostname . "-data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'temp':
|
||||
@@ -107,35 +107,35 @@
|
||||
break;
|
||||
case 'mem':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
$graph = memgraphUnix ($hostname . "-mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = memgraphUnix ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "IOS") {
|
||||
$graph = memgraph ($hostname . "-mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = memgraph ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Windows") {
|
||||
} elseif($os == "ProCurve") {
|
||||
$graph = memgraphHP ($hostname . "-mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = memgraphHP ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'load':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
$graph = loadgraphUnix ($hostname . "-load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = loadgraphUnix ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "IOS") {
|
||||
$graph = loadgraph ($hostname . "-load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = loadgraph ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Windows") {
|
||||
$graph = loadgraphwin ($hostname . "-load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = loadgraphwin ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'users':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
$graph = usersgraphUnix ($hostname . "-sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = usersgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Windows") {
|
||||
$graph = usersgraphwin ($hostname . "-sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = usersgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'procs':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
$graph = procsgraphUnix ($hostname . "-sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = procsgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
} elseif($os == "Windows") {
|
||||
$graph = procsgraphwin ($hostname . "-sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = procsgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'unixfs':
|
||||
@@ -146,7 +146,7 @@
|
||||
case 'postfix':
|
||||
case 'mail':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
||||
$graph = mailsgraphUnix ($hostname . "-mailstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = mailsgraphUnix ($hostname . "/mailstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'mailerrors':
|
||||
@@ -157,17 +157,17 @@
|
||||
break;
|
||||
case 'courier':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
||||
$graph = couriergraphUnix ($hostname . "-courierstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = couriergraphUnix ($hostname . "/courierstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'apachehits':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
||||
$graph = apachehitsgraphUnix ($hostname . "-apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = apachehitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'apachebits':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
||||
$graph = apachebitsgraphUnix ($hostname . "-apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = apachebitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ function temp_graph ($temp, $graph, $from, $to, $width, $height, $title, $vertic
|
||||
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
|
||||
$temperature['temp_descr_fixed'] = str_pad($temperature['temp_descr'], 28);
|
||||
$temperature['temp_descr_fixed'] = substr($temperature['temp_descr_fixed'],0,28);
|
||||
$temprrd = addslashes("rrd/$hostname-temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = addslashes("rrd/$hostname/temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = str_replace(")", "_", $temprrd);
|
||||
$temprrd = str_replace("(", "_", $temprrd);
|
||||
$opts[] = "DEF:temp" . $temperature[temp_id] . "=$temprrd:temp:AVERAGE";
|
||||
@@ -117,7 +117,7 @@ function temp_graph_dev ($device, $graph, $from, $to, $width, $height, $title, $
|
||||
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
|
||||
$temperature['temp_descr_fixed'] = str_pad($temperature['temp_descr'], 28);
|
||||
$temperature['temp_descr_fixed'] = substr($temperature['temp_descr_fixed'],0,28);
|
||||
$temprrd = addslashes("rrd/$hostname-temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = addslashes("rrd/$hostname/temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = str_replace(")", "_", $temprrd);
|
||||
$temprrd = str_replace("(", "_", $temprrd);
|
||||
$options .= " DEF:temp" . $temperature[temp_id] . "=$temprrd:temp:AVERAGE ";
|
||||
|
||||
@@ -4,12 +4,19 @@
|
||||
$id = $device['device_id'];
|
||||
$hostname = $device['hostname'];
|
||||
|
||||
$temprrd = "rrd/" . $hostname . "-temp.rrd";
|
||||
$tempgraph = "public_html/graphs/" . $hostname . "-temp.png";
|
||||
$cpurrd = "rrd/" . $hostname . "-cpu.rrd";
|
||||
$cpugraph = "public_html/graphs/" . $hostname . "-cpu.png";
|
||||
$memrrd = "rrd/" . $hostname . "-mem.rrd";
|
||||
$memgraph = "public_html/graphs/" . $hostname . "-mem.png";
|
||||
$Otemprrd = "rrd/" . $hostname . "-temp.rrd";
|
||||
$Ocpurrd = "rrd/" . $hostname . "-cpu.rrd";
|
||||
$Omemrrd = "rrd/" . $hostname . "-mem.rrd";
|
||||
|
||||
$temprrd = $rrd_dir . "/" . $hostname . "/temp.rrd";
|
||||
$cpurrd = $rrd_dir . "/" . $hostname . "/cpu.rrd";
|
||||
$memrrd = $rrd_dir . "/" . $hostname . "/mem.rrd";
|
||||
|
||||
if(is_file($Otemprrd) && !is_file($temprrd)) { rename($Otemprrd, $temprrd); echo("Moving $Otemprrd to $temprrd"); }
|
||||
if(is_file($Ocpurrd) && !is_file($cpurrd)) { rename($Ocpurrd, $cpurrd); echo("Moving $Ocpurrd to $cpurrd"); }
|
||||
if(is_file($Omemrrd) && !is_file($memrrd)) { rename($Omemrrd, $memrrd); echo("Moving $Omemrrd to $memrrd"); }
|
||||
|
||||
|
||||
list ($cpu5m, $cpu5s) = explode("\n", `snmpget -O qv -v2c -c $community $hostname 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0`);
|
||||
$cpu5m = $cpu5m + 0;
|
||||
$cpu5s = $cpu5s + 0;
|
||||
|
||||
@@ -12,7 +12,11 @@ if($device[os] != "Snom") {
|
||||
'tcpEstabResets','tcpInSegs','tcpOutSegs','tcpRetransSegs','udpInDatagrams','udpOutDatagrams','udpInErrors',
|
||||
'udpNoPorts');
|
||||
|
||||
$rrdfile = "rrd/" . $device['hostname'] . "-netinfo.rrd";
|
||||
$rrdfile = $rrd_file . "/" . $device['hostname'] . "/netinfo.rrd";
|
||||
|
||||
$Orrdfile = "rrd/" . $device['hostname'] . "-netinfo.rrd";
|
||||
if(is_file($Orrdfile) && !is_file($rrdfile)) { rename($Orrdfile, $rrdfile); echo("Moving $Orrdfile to $rrdfile"); }
|
||||
|
||||
$rrd_create = "rrdtool create $rrdfile ";
|
||||
$rrd_create .= "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";
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<?
|
||||
|
||||
$cpurrd = "rrd/" . $device['hostname'] . "-cpu.rrd";
|
||||
$memrrd = "rrd/" . $device['hostname'] . "-mem.rrd";
|
||||
$Ocpurrd = "rrd/" . $hostname . "-cpu.rrd";
|
||||
$Omemrrd = "rrd/" . $hostname . "-mem.rrd";
|
||||
|
||||
$cpurrd = $rrd_dir . "/" . $hostname . "/cpu.rrd";
|
||||
$memrrd = $rrd_dir . "/" . $hostname . "/mem.rrd";
|
||||
|
||||
if(is_file($Ocpurrd) && !is_file($cpurrd)) { rename($Ocpurrd, $cpurrd); echo("Moving $Ocpurrd to $cpurrd"); }
|
||||
if(is_file($Omemrrd) && !is_file($memrrd)) { rename($Omemrrd, $memrrd); echo("Moving $Omemrrd to $memrrd"); }
|
||||
|
||||
|
||||
$cpu_cmd = "snmpget -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " 1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0";
|
||||
$cpu = `$cpu_cmd`;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
$rxbytes = 0 - $rxbytes * 8;
|
||||
echo("$rxbytes, $rxpkts, $txbytes, $txpkts, $calls, $registrations");
|
||||
|
||||
$rrdfile = "rrd/" . $device['hostname'] . "-data.rrd";
|
||||
$rrdfile = $rrd_dir . "/" . $device['hostname'] . "/data.rrd";
|
||||
if(!is_file($rrdfile)) {
|
||||
$woo = `rrdtool create $rrdfile \
|
||||
DS:INOCTETS:COUNTER:600:U:100000000000 \
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
<?php
|
||||
|
||||
$loadrrd = "rrd/" . $device['hostname'] . "-load.rrd";
|
||||
$cpurrd = "rrd/" . $device['hostname'] . "-cpu.rrd";
|
||||
$memrrd = "rrd/" . $device['hostname'] . "-mem.rrd";
|
||||
$sysrrd = "rrd/" . $device['hostname'] . "-sys.rrd";
|
||||
$Oloadrrd = "rrd/" . $device['hostname'] . "-load.rrd";
|
||||
$Ocpurrd = "rrd/" . $device['hostname'] . "-cpu.rrd";
|
||||
$Omemrrd = "rrd/" . $device['hostname'] . "-mem.rrd";
|
||||
$Osysrrd = "rrd/" . $device['hostname'] . "-sys.rrd";
|
||||
|
||||
$loadrrd = $rrd_dir . "/" . $device['hostname'] . "/load.rrd";
|
||||
$cpurrd = $rrd_dir . "/" . $device['hostname'] . "/cpu.rrd";
|
||||
$memrrd = $rrd_dir . "/" . $device['hostname'] . "/mem.rrd";
|
||||
$sysrrd = $rrd_dir . "/" . $device['hostname'] . "/sys.rrd";
|
||||
|
||||
if(is_file($Oloadrrd) && !is_file($loadrrd)) { rename($Oloadrrd, $loadrrd); echo("Moving $Oloadrrd to $loadrrd"); }
|
||||
if(is_file($Ocpurrd) && !is_file($cpurrd)) { rename($Ocpurrd, $cpurrd); echo("Moving $Ocpurrd to $cpurrd"); }
|
||||
if(is_file($Omemrrd) && !is_file($memrrd)) { rename($Omemrrd, $memrrd); echo("Moving $Omemrrd to $memrrd"); }
|
||||
if(is_file($Osysrrd) && !is_file($sysrrd)) { rename($Osysrrd, $sysrrd); echo("Moving $Osysrrd to $sysrrd"); }
|
||||
|
||||
|
||||
|
||||
## Check Disks
|
||||
$dq = mysql_query("SELECT * FROM storage WHERE host_id = '" . $device['device_id'] . "'");
|
||||
@@ -18,9 +30,15 @@ while ($dr = mysql_fetch_array($dq)) {
|
||||
$perc = round($used / $hrStorageSize * 100, 2);
|
||||
|
||||
$filedesc = str_replace("\"", "", str_replace("/", "_", $hrStorageDescr));
|
||||
$storerrd = "rrd/" . $device['hostname'] . "-storage-" . $filedesc . ".rrd";
|
||||
if (!is_file($storerrd)) {
|
||||
`rrdtool create $storerrd \
|
||||
|
||||
$storage_rrd = $rrd_dir . "/" . $device['hostname'] . "/storage-" . $filedesc . ".rrd";
|
||||
$ostorage_rrd = "rrd/" . $device['hostname'] . "-storage-" . $filedesc . ".rrd";
|
||||
|
||||
if(is_file($ostorage_rrd) && !is_file($storage_rrd)) { rename($ostorage_rrd, $storage_rrd); echo("Moving $ostorage_rrd to $storage_rrd"); }
|
||||
|
||||
|
||||
if (!is_file($storage_rrd)) {
|
||||
`rrdtool create $storage_rrd \
|
||||
--step 300 \
|
||||
DS:size:GAUGE:600:0:U \
|
||||
DS:used:GAUGE:600:0:U \
|
||||
@@ -34,7 +52,7 @@ while ($dr = mysql_fetch_array($dq)) {
|
||||
RRA:MAX:0.5:24:800 \
|
||||
RRA:MAX:0.5:288:800`;
|
||||
}
|
||||
rrdtool_update($storerrd, "N:$hrStorageSize:$used:$perc");
|
||||
rrdtool_update($storage_rrd, "N:$hrStorageSize:$used:$perc");
|
||||
mysql_query("UPDATE `storage` SET `hrStorageUsed` = '$used_units', `storage_perc` = '$perc' WHERE storage_id = '" . $dr['storage_id'] . "'");
|
||||
|
||||
if($dr['storage_perc'] < '40' && $perc >= '40') {
|
||||
|
||||
@@ -9,10 +9,15 @@ while($temperature = mysql_fetch_array($temp_data)) {
|
||||
|
||||
echo("Checking temp " . $temperature['temp_descr'] . "... ");
|
||||
|
||||
$temprrd = addslashes("rrd/" . $device['hostname'] . "-temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = addslashes($rrd_dir . "/" . $device['hostname'] . "/temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$temprrd = str_replace(")", "_", $temprrd);
|
||||
$temprrd = str_replace("(", "_", $temprrd);
|
||||
|
||||
$otemprrd = addslashes("rrd/" . $device['hostname'] . "-temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
|
||||
$otemprrd = str_replace(")", "_", $otemprrd);
|
||||
$otemprrd = str_replace("(", "_", $otemprrd);
|
||||
|
||||
if(is_file($otemprrd) && !is_file($temprrd)) { rename($otemprrd, $temprrd); echo("Moving $otemprrd to $temprrd"); }
|
||||
|
||||
if (!is_file($temprrd)) {
|
||||
`rrdtool create $temprrd \
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// Start Graphing Functions
|
||||
|
||||
function mailerrorgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
@@ -14,7 +14,7 @@ function mailerrorgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
|
||||
$points_per_sample = 3;
|
||||
$xpoints = '540';
|
||||
$step = $range*$points_per_sample/$xpoints;
|
||||
$database = "rrd/" . $rrd . "-mailstats.rrd";
|
||||
$database = $rrd_dir . "/" . $rrd . "-mailstats.rrd";
|
||||
|
||||
$options .= " DEF:rejected=$database:reject:AVERAGE";
|
||||
$options .= " DEF:mrejected=$database:reject:MAX";
|
||||
@@ -62,8 +62,8 @@ function mailerrorgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
|
||||
}
|
||||
|
||||
function mailsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
@@ -72,7 +72,7 @@ function mailsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
||||
$points_per_sample = 3;
|
||||
$xpoints = '540';
|
||||
$step = $range*$points_per_sample/$xpoints;
|
||||
$rrd = "rrd/" . $rrd;
|
||||
$rrd = $rrd_dir . "/" . $rrd;
|
||||
$options .= " DEF:sent=$rrd:sent:AVERAGE";
|
||||
$options .= " DEF:msent=$rrd:sent:MAX";
|
||||
$options .= " CDEF:rsent=sent,60,*";
|
||||
@@ -100,8 +100,8 @@ function mailsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
||||
}
|
||||
|
||||
function memgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
@@ -165,8 +165,8 @@ function memgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
|
||||
}
|
||||
|
||||
function loadgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
@@ -198,8 +198,8 @@ function loadgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vert
|
||||
|
||||
|
||||
function usersgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
|
||||
@@ -217,8 +217,8 @@ function usersgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
||||
}
|
||||
|
||||
function procsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
|
||||
@@ -239,8 +239,8 @@ function procsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
||||
|
||||
|
||||
function cpugraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
@@ -276,8 +276,8 @@ function cpugraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
|
||||
}
|
||||
|
||||
function couriergraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
@@ -326,8 +326,8 @@ function couriergraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $v
|
||||
}
|
||||
|
||||
function apachehitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
@@ -343,8 +343,7 @@ function apachehitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
|
||||
}
|
||||
|
||||
function unixfsgraph ($id, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024 -l 0";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
@@ -360,9 +359,10 @@ function unixfsgraph ($id, $graph, $from, $to, $width, $height, $title, $vertica
|
||||
$descr = str_pad($fs[hrStorageDescr], 14);
|
||||
$descr = substr($descr,0,14);
|
||||
$text = str_replace("/", "_", $fs['hrStorageDescr']);
|
||||
$options .= " DEF:$fs[storage_id]=rrd/$hostname-storage-$text.rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=rrd/$hostname-storage-$text.rrd:size:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]p=rrd/$hostname-storage-$text.rrd:perc:AVERAGE";
|
||||
$rrd = $rrd_dir . "/$hostname/storage-$text.rrd";
|
||||
$options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]p=$rrd:perc:AVERAGE";
|
||||
$options .= " LINE1.25:$fs[storage_id]p#" . $colour . ":'$descr'";
|
||||
$options .= " GPRINT:$fs[storage_id]s:LAST:%6.2lf%SB";
|
||||
$options .= " GPRINT:$fs[storage_id]:LAST:%6.2lf%SB";
|
||||
@@ -375,8 +375,8 @@ function unixfsgraph ($id, $graph, $from, $to, $width, $height, $title, $vertica
|
||||
|
||||
|
||||
function unixfsgraph_dev ($device, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024 -l 0";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
@@ -391,11 +391,11 @@ function unixfsgraph_dev ($device, $graph, $from, $to, $width, $height, $title,
|
||||
|
||||
$descr = str_pad($fs[hrStorageDescr], 14);
|
||||
$descr = substr($descr,0,14);
|
||||
|
||||
$text = str_replace("/", "_", $fs['hrStorageDescr']);
|
||||
$options .= " DEF:$fs[storage_id]=rrd/$hostname-storage-$text.rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=rrd/$hostname-storage-$text.rrd:size:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]p=rrd/$hostname-storage-$text.rrd:perc:AVERAGE";
|
||||
$rrd = $rrd_dir . "/$hostname/storage-$text.rrd";
|
||||
$options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]p=$rrd:perc:AVERAGE";
|
||||
$options .= " LINE1.25:$fs[storage_id]p#" . $colour . ":'$descr'";
|
||||
$options .= " GPRINT:$fs[storage_id]s:LAST:%6.2lf%SB";
|
||||
$options .= " GPRINT:$fs[storage_id]:LAST:%6.2lf%SB";
|
||||
@@ -407,8 +407,8 @@ function unixfsgraph_dev ($device, $graph, $from, $to, $width, $height, $title,
|
||||
}
|
||||
|
||||
function apachebitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = "rrd/" . $rrd;
|
||||
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir;
|
||||
$database = $rrd_dir . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
|
||||
Reference in New Issue
Block a user