mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-29 08:12:27 +02:00
syntaxer run + manual cleanup
git-svn-id: http://www.observium.org/svn/observer/trunk@2630 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,51 +2,52 @@
|
||||
|
||||
## Polls Apache statistics from script via SNMP
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.6.97.112.97.99.104.101";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.6.97.112.97.99.104.101";
|
||||
|
||||
$apache = snmp_get($device, $oid, $options);
|
||||
$apache = snmp_get($device, $oid, $options);
|
||||
|
||||
echo(" apache");
|
||||
|
||||
list ($total_access, $total_kbyte, $cpuload, $uptime, $reqpersec, $bytespersec, $bytesperreq, $busyworkers, $idleworkers,
|
||||
$score_wait, $score_start, $score_reading, $score_writing, $score_keepalive, $score_dns, $score_closing, $score_logging, $score_graceful, $score_idle, $score_open) = explode("\n", $apache);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:access:DERIVE:600:0:125000000000 \
|
||||
DS:kbyte:DERIVE:600:0:125000000000 \
|
||||
DS:cpu:GAUGE:600:0:125000000000 \
|
||||
DS:uptime:GAUGE:600:0:125000000000 \
|
||||
DS:reqpersec:GAUGE:600:0:125000000000 \
|
||||
DS:bytespersec:GAUGE:600:0:125000000000 \
|
||||
DS:byesperreq:GAUGE:600:0:125000000000 \
|
||||
DS:busyworkers:GAUGE:600:0:125000000000 \
|
||||
DS:idleworkers:GAUGE:600:0:125000000000 \
|
||||
DS:sb_wait:GAUGE:600:0:125000000000 \
|
||||
DS:sb_start:GAUGE:600:0:125000000000 \
|
||||
DS:sb_reading:GAUGE:600:0:125000000000 \
|
||||
DS:sb_writing:GAUGE:600:0:125000000000 \
|
||||
DS:sb_keepalive:GAUGE:600:0:125000000000 \
|
||||
DS:sb_dns:GAUGE:600:0:125000000000 \
|
||||
DS:sb_closing:GAUGE:600:0:125000000000 \
|
||||
DS:sb_logging:GAUGE:600:0:125000000000 \
|
||||
DS:sb_graceful:GAUGE:600:0:125000000000 \
|
||||
DS:sb_idle:GAUGE:600:0:125000000000 \
|
||||
DS:sb_open:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
if (!is_file($rrd_filename))
|
||||
{
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:access:DERIVE:600:0:125000000000 \
|
||||
DS:kbyte:DERIVE:600:0:125000000000 \
|
||||
DS:cpu:GAUGE:600:0:125000000000 \
|
||||
DS:uptime:GAUGE:600:0:125000000000 \
|
||||
DS:reqpersec:GAUGE:600:0:125000000000 \
|
||||
DS:bytespersec:GAUGE:600:0:125000000000 \
|
||||
DS:byesperreq:GAUGE:600:0:125000000000 \
|
||||
DS:busyworkers:GAUGE:600:0:125000000000 \
|
||||
DS:idleworkers:GAUGE:600:0:125000000000 \
|
||||
DS:sb_wait:GAUGE:600:0:125000000000 \
|
||||
DS:sb_start:GAUGE:600:0:125000000000 \
|
||||
DS:sb_reading:GAUGE:600:0:125000000000 \
|
||||
DS:sb_writing:GAUGE:600:0:125000000000 \
|
||||
DS:sb_keepalive:GAUGE:600:0:125000000000 \
|
||||
DS:sb_dns:GAUGE:600:0:125000000000 \
|
||||
DS:sb_closing:GAUGE:600:0:125000000000 \
|
||||
DS:sb_logging:GAUGE:600:0:125000000000 \
|
||||
DS:sb_graceful:GAUGE:600:0:125000000000 \
|
||||
DS:sb_idle:GAUGE:600:0:125000000000 \
|
||||
DS:sb_open:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, "N:$total_access:$total_kbyte:$cpuload:$uptime:$reqpersec:$bytespersec:$bytesperreq:$busyworkers:$idleworkers:$score_wait:$score_start:$score_reading:$score_writing:$score_keepalive:$score_dns:$score_closing:$score_logging:$score_graceful:$score_idle:$score_open");
|
||||
|
||||
@@ -2,35 +2,36 @@
|
||||
|
||||
## Polls ntp-client statistics from script via SNMP
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.9.110.116.112.99.108.105.101.110.116";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.9.110.116.112.99.108.105.101.110.116";
|
||||
|
||||
$ntpclient = snmp_get($device, $oid, $options);
|
||||
$ntpclient = snmp_get($device, $oid, $options);
|
||||
|
||||
echo(" ntp-client");
|
||||
|
||||
list ($offset, $frequency, $jitter, $noise, $stability) = explode("\n", $ntpclient);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:offset:GAUGE:600:0:125000000000 \
|
||||
DS:frequency:GAUGE:600:0:125000000000 \
|
||||
DS:jitter:GAUGE:600:0:125000000000 \
|
||||
DS:noise:GAUGE:600:0:125000000000 \
|
||||
DS:stability:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
if (!is_file($rrd_filename))
|
||||
{
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:offset:GAUGE:600:0:125000000000 \
|
||||
DS:frequency:GAUGE:600:0:125000000000 \
|
||||
DS:jitter:GAUGE:600:0:125000000000 \
|
||||
DS:noise:GAUGE:600:0:125000000000 \
|
||||
DS:stability:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, "N:$offset:$frequency:$jitter:$noise:$stability");
|
||||
|
||||
@@ -2,44 +2,45 @@
|
||||
|
||||
## Polls ntpd-server statistics from script via SNMP
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.10.110.116.112.100.115.101.114.118.101.114";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.10.110.116.112.100.115.101.114.118.101.114";
|
||||
|
||||
$ntpdserver = snmp_get($device, $oid, $options);
|
||||
$ntpdserver = snmp_get($device, $oid, $options);
|
||||
|
||||
echo(" ntpd-server");
|
||||
|
||||
list ($stratum, $offset, $frequency, $jitter, $noise, $stability, $uptime, $buffer_recv, $buffer_free, $buffer_used, $packets_drop, $packets_ignore, $packets_recv, $packets_sent) = explode("\n", $ntpdserver);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:stratum:GAUGE:600:0:125000000000 \
|
||||
DS:offset:GAUGE:600:0:125000000000 \
|
||||
DS:frequency:GAUGE:600:0:125000000000 \
|
||||
DS:jitter:GAUGE:600:0:125000000000 \
|
||||
DS:noise:GAUGE:600:0:125000000000 \
|
||||
DS:stability:GAUGE:600:0:125000000000 \
|
||||
DS:uptime:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_recv:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_free:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_used:GAUGE:600:0:125000000000 \
|
||||
DS:packets_drop:DERIVE:600:0:125000000000 \
|
||||
DS:packets_ignore:DERIVE:600:0:125000000000 \
|
||||
DS:packets_recv:DERIVE:600:0:125000000000 \
|
||||
DS:packets_sent:DERIVE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
if (!is_file($rrd_filename))
|
||||
{
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:stratum:GAUGE:600:0:125000000000 \
|
||||
DS:offset:GAUGE:600:0:125000000000 \
|
||||
DS:frequency:GAUGE:600:0:125000000000 \
|
||||
DS:jitter:GAUGE:600:0:125000000000 \
|
||||
DS:noise:GAUGE:600:0:125000000000 \
|
||||
DS:stability:GAUGE:600:0:125000000000 \
|
||||
DS:uptime:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_recv:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_free:GAUGE:600:0:125000000000 \
|
||||
DS:buffer_used:GAUGE:600:0:125000000000 \
|
||||
DS:packets_drop:DERIVE:600:0:125000000000 \
|
||||
DS:packets_ignore:DERIVE:600:0:125000000000 \
|
||||
DS:packets_recv:DERIVE:600:0:125000000000 \
|
||||
DS:packets_sent:DERIVE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, "N:$stratum:$offset:$frequency:$jitter:$noise:$stability:$uptime:$buffer_recv:$buffer_free:$buffer_used:$packets_drop:$packets_ignore:$packets_recv:$packets_sent");
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
## Polls powerdns statistics from script via SNMP
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.8.112.111.119.101.114.100.110.115";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.8.112.111.119.101.114.100.110.115";
|
||||
|
||||
$powerdns = snmp_get($device, $oid, $options);
|
||||
$powerdns = snmp_get($device, $oid, $options);
|
||||
|
||||
echo(" powerdns");
|
||||
|
||||
@@ -14,42 +14,43 @@ list ($corrupt, $def_cacheInserts, $def_cacheLookup, $latency, $pc_hit, $pc_miss
|
||||
$qc_miss, $rec_answers, $rec_questions, $servfail, $tcp_answers, $tcp_queries, $timedout,
|
||||
$udp_answers, $udp_queries, $udp4_answers, $udp4_queries, $udp6_answers, $udp6_queries) = explode("\n", $powerdns);
|
||||
|
||||
if (!is_file($rrd_filename)) {
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:corruptPackets:DERIVE:600:0:125000000000 \
|
||||
DS:def_cacheInserts:DERIVE:600:0:125000000000 \
|
||||
DS:def_cacheLookup:DERIVE:600:0:125000000000 \
|
||||
DS:latency:DERIVE:600:0:125000000000 \
|
||||
DS:pc_hit:DERIVE:600:0:125000000000 \
|
||||
DS:pc_miss:DERIVE:600:0:125000000000 \
|
||||
DS:pc_size:DERIVE:600:0:125000000000 \
|
||||
DS:qsize:DERIVE:600:0:125000000000 \
|
||||
DS:qc_hit:DERIVE:600:0:125000000000 \
|
||||
DS:qc_miss:DERIVE:600:0:125000000000 \
|
||||
DS:rec_answers:DERIVE:600:0:125000000000 \
|
||||
DS:rec_questions:DERIVE:600:0:125000000000 \
|
||||
DS:servfailPackets:DERIVE:600:0:125000000000 \
|
||||
DS:q_tcpAnswers:DERIVE:600:0:125000000000 \
|
||||
DS:q_tcpQueries:DERIVE:600:0:125000000000 \
|
||||
DS:q_timedout:DERIVE:600:0:125000000000 \
|
||||
DS:q_udpAnswers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udpQueries:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp4Answers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp4Queries:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp6Answers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp6Queries:DERIVE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
if (!is_file($rrd_filename))
|
||||
{
|
||||
rrdtool_create($rrd_filename, "--step 300 \
|
||||
DS:corruptPackets:DERIVE:600:0:125000000000 \
|
||||
DS:def_cacheInserts:DERIVE:600:0:125000000000 \
|
||||
DS:def_cacheLookup:DERIVE:600:0:125000000000 \
|
||||
DS:latency:DERIVE:600:0:125000000000 \
|
||||
DS:pc_hit:DERIVE:600:0:125000000000 \
|
||||
DS:pc_miss:DERIVE:600:0:125000000000 \
|
||||
DS:pc_size:DERIVE:600:0:125000000000 \
|
||||
DS:qsize:DERIVE:600:0:125000000000 \
|
||||
DS:qc_hit:DERIVE:600:0:125000000000 \
|
||||
DS:qc_miss:DERIVE:600:0:125000000000 \
|
||||
DS:rec_answers:DERIVE:600:0:125000000000 \
|
||||
DS:rec_questions:DERIVE:600:0:125000000000 \
|
||||
DS:servfailPackets:DERIVE:600:0:125000000000 \
|
||||
DS:q_tcpAnswers:DERIVE:600:0:125000000000 \
|
||||
DS:q_tcpQueries:DERIVE:600:0:125000000000 \
|
||||
DS:q_timedout:DERIVE:600:0:125000000000 \
|
||||
DS:q_udpAnswers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udpQueries:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp4Answers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp4Queries:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp6Answers:DERIVE:600:0:125000000000 \
|
||||
DS:q_udp6Queries:DERIVE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
|
||||
rrdtool_update($rrd_filename, "N:$corrupt:$def_cacheInserts:$def_cacheLookup:$latency:$pc_hit:$pc_miss:$pc_size:$qsize:$qc_hit:$qc_miss:$rec_answers:$rec_questions:$servfail:$tcp_answers:$tcp_queries:$timedout:$udp_answers:$udp_queries:$udp4_answers:$udp4_queries:$udp6_answers:$udp6_queries");
|
||||
|
||||
@@ -2,54 +2,60 @@
|
||||
|
||||
## Polls shoutcast statistics from script via SNMP
|
||||
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.9.115.104.111.117.116.99.97.115.116";
|
||||
$options = "-O qv";
|
||||
$oid = "nsExtendOutputFull.9.115.104.111.117.116.99.97.115.116";
|
||||
|
||||
$shoutcast = snmp_get($device, $oid, $options);
|
||||
$shoutcast = snmp_get($device, $oid, $options);
|
||||
|
||||
echo(" shoutcast");
|
||||
|
||||
$servers = explode("\n", $shoutcast);
|
||||
|
||||
foreach ($servers as $item=>$server) {
|
||||
$server = trim($server);
|
||||
if (!empty($server)) {
|
||||
$data = explode(";", $server);
|
||||
list($host, $port) = split(":", $data['0'], 2);
|
||||
$bitrate = $data['1'];
|
||||
$traf_in = $data['2'];
|
||||
$traf_out = $data['3'];
|
||||
$current = $data['4'];
|
||||
$status = $data['5'];
|
||||
$peak = $data['6'];
|
||||
$max = $data['7'];
|
||||
$unique = $data['8'];
|
||||
$rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-shoutcast-".$app['app_id']."-".$host."_".$port.".rrd";
|
||||
if (!is_file($rrdfile)) {
|
||||
rrdtool_create($rrdfile, "--step 300 \
|
||||
DS:bitrate:GAUGE:600:0:125000000000 \
|
||||
DS:traf_in:GAUGE:600:0:125000000000 \
|
||||
DS:traf_out:GAUGE:600:0:125000000000 \
|
||||
DS:current:GAUGE:600:0:125000000000 \
|
||||
DS:status:GAUGE:600:0:125000000000 \
|
||||
DS:peak:GAUGE:600:0:125000000000 \
|
||||
DS:max:GAUGE:600:0:125000000000 \
|
||||
DS:unique:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
rrdtool_update($rrdfile, "N:$bitrate:$traf_in:$traf_out:$current:$status:$peak:$max:$unique");
|
||||
foreach ($servers as $item=>$server)
|
||||
{
|
||||
$server = trim($server);
|
||||
|
||||
if (!empty($server))
|
||||
{
|
||||
$data = explode(";", $server);
|
||||
list($host, $port) = split(":", $data['0'], 2);
|
||||
$bitrate = $data['1'];
|
||||
$traf_in = $data['2'];
|
||||
$traf_out = $data['3'];
|
||||
$current = $data['4'];
|
||||
$status = $data['5'];
|
||||
$peak = $data['6'];
|
||||
$max = $data['7'];
|
||||
$unique = $data['8'];
|
||||
$rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-shoutcast-".$app['app_id']."-".$host."_".$port.".rrd";
|
||||
|
||||
if (!is_file($rrdfile))
|
||||
{
|
||||
rrdtool_create($rrdfile, "--step 300 \
|
||||
DS:bitrate:GAUGE:600:0:125000000000 \
|
||||
DS:traf_in:GAUGE:600:0:125000000000 \
|
||||
DS:traf_out:GAUGE:600:0:125000000000 \
|
||||
DS:current:GAUGE:600:0:125000000000 \
|
||||
DS:status:GAUGE:600:0:125000000000 \
|
||||
DS:peak:GAUGE:600:0:125000000000 \
|
||||
DS:max:GAUGE:600:0:125000000000 \
|
||||
DS:unique:GAUGE:600:0:125000000000 \
|
||||
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:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN: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");
|
||||
}
|
||||
|
||||
rrdtool_update($rrdfile, "N:$bitrate:$traf_in:$traf_out:$current:$status:$peak:$max:$unique");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user