From c15bfa62a46ec06f76c0d69e11d61c4b2019efa3 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sat, 1 Oct 2011 10:10:02 +0000 Subject: [PATCH] syntaxer run + manual cleanup git-svn-id: http://www.observium.org/svn/observer/trunk@2630 61d68cd4-352d-0410-923a-c4978735b2b8 --- README | 14 +- .../graphs/application/ntpclient_freq.inc.php | 27 +-- .../application/ntpclient_stats.inc.php | 50 +++--- .../application/ntpdserver_bits.inc.php | 43 ++--- .../application/ntpdserver_buffer.inc.php | 50 +++--- .../application/ntpdserver_freq.inc.php | 27 +-- .../application/ntpdserver_packets.inc.php | 46 ++--- .../application/ntpdserver_stats.inc.php | 50 +++--- .../application/ntpdserver_stratum.inc.php | 27 +-- .../application/ntpdserver_uptime.inc.php | 60 ++++--- .../graphs/application/powerdns_fail.inc.php | 50 +++--- .../application/powerdns_latency.inc.php | 27 +-- .../application/powerdns_packetcache.inc.php | 50 +++--- .../application/powerdns_queries.inc.php | 52 +++--- .../application/powerdns_queries_udp.inc.php | 52 +++--- .../application/powerdns_querycache.inc.php | 48 ++--- .../application/powerdns_recursing.inc.php | 48 ++--- .../graphs/application/shoutcast_bits.inc.php | 34 ++-- .../application/shoutcast_multi_bits.inc.php | 79 ++++---- .../application/shoutcast_multi_stats.inc.php | 168 ++++++++++-------- .../application/shoutcast_stats.inc.php | 75 ++++---- .../graphs/device/smokeping_common.inc.php | 2 +- .../generic_multi_simplex_seperated.inc.php | 2 +- html/pages/device.inc.php | 41 +++-- html/pages/device/apps/shoutcast.inc.php | 114 ++++++------ html/pages/device/latency.inc.php | 4 +- includes/polling/applications/apache.inc.php | 77 ++++---- .../polling/applications/ntp-client.inc.php | 47 ++--- .../polling/applications/ntpd-server.inc.php | 65 +++---- .../polling/applications/powerdns.inc.php | 81 ++++----- .../polling/applications/shoutcast.inc.php | 88 ++++----- 31 files changed, 836 insertions(+), 762 deletions(-) diff --git a/README b/README index 72f248b6fd..ee204e0353 100644 --- a/README +++ b/README @@ -18,18 +18,18 @@ Please see LICENSES/GPLv3-LICENSE.txt for usage requirements and restrictions. Introduction ------------ -Observium is an autodiscovering PHP/MySQL/SNMP based network monitoring which includes -support for a wide range of network hardware and operating systems including Cisco, +Observium is an autodiscovering PHP/MySQL/SNMP based network monitoring which includes +support for a wide range of network hardware and operating systems including Cisco, Linux, FreeBSD, Juniper, Brocade, Foundry, HP and many more. -Observium has grown out of a lack of easy to configure network monitoring platforms. -It is intended to provide a more navigable interface to the health and performance of +Observium has grown out of a lack of easy to configure network monitoring platforms. +It is intended to provide a more navigable interface to the health and performance of your network. Its design goals include collecting as much historical data about devices - as possible, being completely autodiscovered with little or no manual intervention, + as possible, being completely autodiscovered with little or no manual intervention, and having a very intuitive interface. -Observium is not intended to replace an up/down alerting system, but rather to -complement it with an easy to manage, intuitive representation of historical and +Observium is not intended to replace an up/down alerting system, but rather to +complement it with an easy to manage, intuitive representation of historical and current performance statistics, configuration visualisation and syslog capture. Installation diff --git a/html/includes/graphs/application/ntpclient_freq.inc.php b/html/includes/graphs/application/ntpclient_freq.inc.php index fc57bf1be4..01288ad9fb 100644 --- a/html/includes/graphs/application/ntpclient_freq.inc.php +++ b/html/includes/graphs/application/ntpclient_freq.inc.php @@ -1,20 +1,21 @@ diff --git a/html/includes/graphs/application/ntpclient_stats.inc.php b/html/includes/graphs/application/ntpclient_stats.inc.php index bf6f3f0c4a..c83993ebd1 100644 --- a/html/includes/graphs/application/ntpclient_stats.inc.php +++ b/html/includes/graphs/application/ntpclient_stats.inc.php @@ -1,32 +1,34 @@ array('descr' => 'Offset'), - 'jitter' => array('descr' => 'Jitter'), - 'noise' => array('descr' => 'Noise'), - 'stability' => array('descr' => 'Stability') - ); +$colours = "mixed"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Milliseconds"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd"; +$array = array( + 'offset' => array('descr' => 'Offset'), + 'jitter' => array('descr' => 'Jitter'), + 'noise' => array('descr' => 'Noise'), + 'stability' => array('descr' => 'Stability') + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_line.inc.php"); +include("includes/graphs/generic_multi_line.inc.php"); ?> diff --git a/html/includes/graphs/application/ntpdserver_bits.inc.php b/html/includes/graphs/application/ntpdserver_bits.inc.php index 2a4e5a6d8f..1766b72d1b 100644 --- a/html/includes/graphs/application/ntpdserver_bits.inc.php +++ b/html/includes/graphs/application/ntpdserver_bits.inc.php @@ -1,33 +1,34 @@ diff --git a/html/includes/graphs/application/ntpdserver_buffer.inc.php b/html/includes/graphs/application/ntpdserver_buffer.inc.php index 8e08ac3299..47c930f8eb 100644 --- a/html/includes/graphs/application/ntpdserver_buffer.inc.php +++ b/html/includes/graphs/application/ntpdserver_buffer.inc.php @@ -1,32 +1,34 @@ array('descr' => 'Received'), - 'buffer_used' => array('descr' => 'Used'), - 'buffer_free' => array('descr' => 'Free') - ); +$scale_min = 0; +$colours = "mixed"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Buffer"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd"; +$array = array( + 'buffer_recv' => array('descr' => 'Received'), + 'buffer_used' => array('descr' => 'Used'), + 'buffer_free' => array('descr' => 'Free') + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_line.inc.php"); +include("includes/graphs/generic_multi_line.inc.php"); ?> diff --git a/html/includes/graphs/application/ntpdserver_freq.inc.php b/html/includes/graphs/application/ntpdserver_freq.inc.php index 36bf610b7b..f74fc0d092 100644 --- a/html/includes/graphs/application/ntpdserver_freq.inc.php +++ b/html/includes/graphs/application/ntpdserver_freq.inc.php @@ -1,20 +1,21 @@ diff --git a/html/includes/graphs/application/ntpdserver_packets.inc.php b/html/includes/graphs/application/ntpdserver_packets.inc.php index f6316bae4a..86bdc88d0f 100644 --- a/html/includes/graphs/application/ntpdserver_packets.inc.php +++ b/html/includes/graphs/application/ntpdserver_packets.inc.php @@ -1,31 +1,33 @@ array('descr' => 'Dropped', 'colour' => '880000FF'), - 'packets_ignore' => array('descr' => 'Ignored', 'colour' => 'FF8800FF') - ); +$scale_min = 0; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Packets"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd"; +$array = array( + 'packets_drop' => array('descr' => 'Dropped', 'colour' => '880000FF'), + 'packets_ignore' => array('descr' => 'Ignored', 'colour' => 'FF8800FF') + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} // include("includes/graphs/generic_multi_line.inc.php"); - include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); ?> diff --git a/html/includes/graphs/application/ntpdserver_stats.inc.php b/html/includes/graphs/application/ntpdserver_stats.inc.php index 3bc8bd641f..70e1295575 100644 --- a/html/includes/graphs/application/ntpdserver_stats.inc.php +++ b/html/includes/graphs/application/ntpdserver_stats.inc.php @@ -1,32 +1,34 @@ array('descr' => 'Offset'), - 'jitter' => array('descr' => 'Jitter'), - 'noise' => array('descr' => 'Noise'), - 'stability' => array('descr' => 'Stability') - ); +$colours = "mixed"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Milliseconds"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd"; +$array = array( + 'offset' => array('descr' => 'Offset'), + 'jitter' => array('descr' => 'Jitter'), + 'noise' => array('descr' => 'Noise'), + 'stability' => array('descr' => 'Stability') + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i]; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_line.inc.php"); +include("includes/graphs/generic_multi_line.inc.php"); ?> diff --git a/html/includes/graphs/application/ntpdserver_stratum.inc.php b/html/includes/graphs/application/ntpdserver_stratum.inc.php index 3c2b5589f5..e0d59019c1 100644 --- a/html/includes/graphs/application/ntpdserver_stratum.inc.php +++ b/html/includes/graphs/application/ntpdserver_stratum.inc.php @@ -1,20 +1,21 @@ diff --git a/html/includes/graphs/application/ntpdserver_uptime.inc.php b/html/includes/graphs/application/ntpdserver_uptime.inc.php index 97ab24dcff..03c94ce8ad 100644 --- a/html/includes/graphs/application/ntpdserver_uptime.inc.php +++ b/html/includes/graphs/application/ntpdserver_uptime.inc.php @@ -1,36 +1,40 @@ diff --git a/html/includes/graphs/application/powerdns_fail.inc.php b/html/includes/graphs/application/powerdns_fail.inc.php index 51b170f8d3..a5b92fb659 100644 --- a/html/includes/graphs/application/powerdns_fail.inc.php +++ b/html/includes/graphs/application/powerdns_fail.inc.php @@ -1,32 +1,34 @@ array('descr' => 'Corrupt', 'colour' => 'FF8800FF'), - 'servfailPackets' => array('descr' => 'Failed', 'colour' => 'FF0000FF'), - 'q_timedout' => array('descr' => 'Timedout', 'colour' => 'FFFF00FF'), - ); +$scale_min = 0; +$colours = "red"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'corruptPackets' => array('descr' => 'Corrupt', 'colour' => 'FF8800FF'), + 'servfailPackets' => array('descr' => 'Failed', 'colour' => 'FF0000FF'), + 'q_timedout' => array('descr' => 'Timedout', 'colour' => 'FFFF00FF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); ?> diff --git a/html/includes/graphs/application/powerdns_latency.inc.php b/html/includes/graphs/application/powerdns_latency.inc.php index 792b6c0b31..fb8ceb5fff 100644 --- a/html/includes/graphs/application/powerdns_latency.inc.php +++ b/html/includes/graphs/application/powerdns_latency.inc.php @@ -1,20 +1,21 @@ diff --git a/html/includes/graphs/application/powerdns_packetcache.inc.php b/html/includes/graphs/application/powerdns_packetcache.inc.php index 1c9ab63bc1..13f574b4ad 100644 --- a/html/includes/graphs/application/powerdns_packetcache.inc.php +++ b/html/includes/graphs/application/powerdns_packetcache.inc.php @@ -1,32 +1,34 @@ array('descr' => 'Hits', 'colour' => '008800FF'), - 'pc_miss' => array('descr' => 'Misses', 'colour' => '880000FF'), - 'pc_size' => array('descr' => 'Size', 'colour' => '006699FF'), - ); +$scale_min = 0; +$colours = "blue"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'pc_hit' => array('descr' => 'Hits', 'colour' => '008800FF'), + 'pc_miss' => array('descr' => 'Misses', 'colour' => '880000FF'), + 'pc_size' => array('descr' => 'Size', 'colour' => '006699FF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); ?> diff --git a/html/includes/graphs/application/powerdns_queries.inc.php b/html/includes/graphs/application/powerdns_queries.inc.php index 61750f82fa..71b2a0be04 100644 --- a/html/includes/graphs/application/powerdns_queries.inc.php +++ b/html/includes/graphs/application/powerdns_queries.inc.php @@ -1,33 +1,35 @@ array('descr' => 'TCP Answers', 'colour' => '008800FF'), - 'q_tcpQueries' => array('descr' => 'TCP Queries', 'colour' => '00FF00FF'), - 'q_udpAnswers' => array('descr' => 'UDP Answers', 'colour' => '336699FF'), - 'q_udpQueries' => array('descr' => 'UDP Queries', 'colour' => '6699CCFF'), - ); +$scale_min = 0; +$colours = "mixed"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'q_tcpAnswers' => array('descr' => 'TCP Answers', 'colour' => '008800FF'), + 'q_tcpQueries' => array('descr' => 'TCP Queries', 'colour' => '00FF00FF'), + 'q_udpAnswers' => array('descr' => 'UDP Answers', 'colour' => '336699FF'), + 'q_udpQueries' => array('descr' => 'UDP Queries', 'colour' => '6699CCFF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); ?> diff --git a/html/includes/graphs/application/powerdns_queries_udp.inc.php b/html/includes/graphs/application/powerdns_queries_udp.inc.php index c607a0075f..ef2b6afd73 100644 --- a/html/includes/graphs/application/powerdns_queries_udp.inc.php +++ b/html/includes/graphs/application/powerdns_queries_udp.inc.php @@ -1,33 +1,35 @@ array('descr' => 'UDP4 Answers', 'colour' => '00008888'), - 'q_udp4Queries' => array('descr' => 'UDP4 Queries', 'colour' => '000088FF'), - 'q_udp6Answers' => array('descr' => 'UDP6 Answers', 'colour' => '88000088'), - 'q_udp6Queries' => array('descr' => 'UDP6 Queries', 'colour' => '880000FF'), - ); +$scale_min = 0; +$colours = "mixed"; +$nototal = (($width<224) ? 1 : 0); +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'q_udp4Answers' => array('descr' => 'UDP4 Answers', 'colour' => '00008888'), + 'q_udp4Queries' => array('descr' => 'UDP4 Queries', 'colour' => '000088FF'), + 'q_udp6Answers' => array('descr' => 'UDP6 Answers', 'colour' => '88000088'), + 'q_udp6Queries' => array('descr' => 'UDP6 Queries', 'colour' => '880000FF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); ?> diff --git a/html/includes/graphs/application/powerdns_querycache.inc.php b/html/includes/graphs/application/powerdns_querycache.inc.php index 1db491c10c..1ad4f3821c 100644 --- a/html/includes/graphs/application/powerdns_querycache.inc.php +++ b/html/includes/graphs/application/powerdns_querycache.inc.php @@ -1,31 +1,33 @@ array('descr' => 'Misses', 'colour' => '750F7DFF'), - 'qc_hit' => array('descr' => 'Hits', 'colour' => '00FF00FF'), - ); +$scale_min = 0; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'qc_miss' => array('descr' => 'Misses', 'colour' => '750F7DFF'), + 'qc_hit' => array('descr' => 'Hits', 'colour' => '00FF00FF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_line.inc.php"); +include("includes/graphs/generic_multi_line.inc.php"); ?> diff --git a/html/includes/graphs/application/powerdns_recursing.inc.php b/html/includes/graphs/application/powerdns_recursing.inc.php index 772d5a3f92..758b3ee236 100644 --- a/html/includes/graphs/application/powerdns_recursing.inc.php +++ b/html/includes/graphs/application/powerdns_recursing.inc.php @@ -1,31 +1,33 @@ array('descr' => 'Questions', 'colour' => '6699CCFF'), - 'rec_answers' => array('descr' => 'Answers', 'colour' => '336699FF'), - ); +$scale_min = 0; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Packets/sec"; +$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd"; +$array = array( + 'rec_questions' => array('descr' => 'Questions', 'colour' => '6699CCFF'), + 'rec_answers' => array('descr' => 'Answers', 'colour' => '336699FF'), + ); - $i = 0; +$i = 0; - if (is_file($rrd_filename)) { - foreach ($array as $ds => $vars) { - $rrd_list[$i]['filename'] = $rrd_filename; - $rrd_list[$i]['descr'] = $vars['descr']; - $rrd_list[$i]['ds'] = $ds; - $rrd_list[$i]['colour'] = $vars['colour']; - $i++; - } - } else { - echo("file missing: $file"); - } +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; + $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { + echo("file missing: $file"); +} - include("includes/graphs/generic_multi_line.inc.php"); +include("includes/graphs/generic_multi_line.inc.php"); ?> diff --git a/html/includes/graphs/application/shoutcast_bits.inc.php b/html/includes/graphs/application/shoutcast_bits.inc.php index ec71155054..d695ca1692 100644 --- a/html/includes/graphs/application/shoutcast_bits.inc.php +++ b/html/includes/graphs/application/shoutcast_bits.inc.php @@ -1,27 +1,27 @@ diff --git a/html/includes/graphs/application/shoutcast_multi_bits.inc.php b/html/includes/graphs/application/shoutcast_multi_bits.inc.php index 587ff5a166..8a50b406dd 100644 --- a/html/includes/graphs/application/shoutcast_multi_bits.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_bits.inc.php @@ -1,49 +1,54 @@ $file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); - list($host, $port) = split('_', $hostname, 2); - $rrd_filenames[] = $rrddir."/".$file; - $rrd_list[$i]['filename'] = $rrddir."/".$file; - $rrd_list[$i]['descr'] = $host.":".$port; - $rrd_list[$i]['ds_in'] = $ds_in; - $rrd_list[$i]['ds_out'] = $ds_out; - $i++; +if ($handle = opendir($rrddir)) +{ + while (false !== ($file = readdir($handle))) + { + if ($file != "." && $file != "..") + { + if (eregi("app-shoutcast-".$app['app_id'], $file)) + { + array_push($files, $file); + } } + } +} - include("includes/graphs/generic_multi_bits_separated.inc.php"); +foreach ($files as $id => $file) +{ + $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = eregi_replace('.rrd', '', $hostname); + list($host, $port) = split('_', $hostname, 2); + $rrd_filenames[] = $rrddir."/".$file; + $rrd_list[$i]['filename'] = $rrddir."/".$file; + $rrd_list[$i]['descr'] = $host.":".$port; + $rrd_list[$i]['ds_in'] = $ds_in; + $rrd_list[$i]['ds_out'] = $ds_out; + $i++; +} + +include("includes/graphs/generic_multi_bits_separated.inc.php"); ?> diff --git a/html/includes/graphs/application/shoutcast_multi_stats.inc.php b/html/includes/graphs/application/shoutcast_multi_stats.inc.php index ab8563f969..2e06638228 100644 --- a/html/includes/graphs/application/shoutcast_multi_stats.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_stats.inc.php @@ -1,90 +1,102 @@ $file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); - list($host, $port) = split('_', $hostname, 2); - $rrd_filenames[] = $rrddir."/".$file; - $rrd_list[$i]['filename'] = $rrddir."/".$file; - $rrd_list[$i]['descr'] = $host.":".$port; - $rrd_list[$i]['colour'] = $colour; - $i++; - } +foreach ($files as $id => $file) +{ + $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = eregi_replace('.rrd', '', $hostname); + list($host, $port) = split('_', $hostname, 2); + $rrd_filenames[] = $rrddir."/".$file; + $rrd_list[$i]['filename'] = $rrddir."/".$file; + $rrd_list[$i]['descr'] = $host.":".$port; + $rrd_list[$i]['colour'] = $colour; + $i++; +} - include("includes/graphs/common.inc.php"); +include("includes/graphs/common.inc.php"); - if ($width > "500") { - $descr_len = 38; - } else { - $descr_len = 8; - $descr_len += round(($width - 250) / 8); - } +if ($width > "500") +{ + $descr_len = 38; +} else { + $descr_len = 8; + $descr_len += round(($width - 250) / 8); +} - if ($width > "500") { - $rrd_options .= " COMMENT:\"".substr(str_pad($unit_text, $descr_len+2), 0, $descr_len+2)." Current Unique Average Peak\\n\""; - } else { - $rrd_options .= " COMMENT:\"".substr(str_pad($unit_text, $descr_len+5), 0, $descr_len+5)." Now Unique Average Peak\\n\""; - } - foreach ($rrd_list as $rrd) { - $colours = (isset($rrd['colour']) ? $rrd['colour'] : "default"); - $strlen = ((strlen($rrd['descr'])<$descr_len) ? ($descr_len - strlen($rrd['descr'])) : "0"); - $descr = (isset($rrd['descr']) ? str_replace(":", "\:", substr(str_pad($rrd['descr'], $desc_len+$strlen), 0, $descr_len+$strlen)) : "Unkown"); - for ($z=0; $z<$strlen; $z++) { $descr .= " "; } - if ($i) { $stack = "STACK"; } - $colour = $config['graph_colours'][$colours][$x]; - $rrd_options .= " DEF:cur".$x."=".$rrd['filename'].":current:AVERAGE"; - $rrd_options .= " DEF:peak".$x."=".$rrd['filename'].":peak:MAX"; - $rrd_options .= " DEF:unique".$x."=".$rrd['filename'].":unique:AVERAGE"; - $rrd_options .= " VDEF:avg".$x."=cur".$x.",AVERAGE"; - $rrd_options .= " AREA:cur".$x."#".$colour.":\"".$descr."\":$stack"; - $rrd_options .= " GPRINT:cur".$x.":LAST:\"%6.2lf\""; - $rrd_options .= " GPRINT:unique".$x.":LAST:\"%6.2lf%s\""; - $rrd_options .= " GPRINT:avg".$x.":\"%6.2lf\""; - $rrd_options .= " GPRINT:peak".$x.":LAST:\"%6.2lf\""; - $rrd_options .= " COMMENT:\"\\n\""; - if ($x) { - $totcur .= ",cur".$x.",+"; - $totpeak .= ",peak".$x.",+"; - $totunique .= ",unique".$x.",+"; - } - $x = (($x "500") +{ + $rrd_options .= " COMMENT:\"".substr(str_pad($unit_text, $descr_len+2), 0, $descr_len+2)." Current Unique Average Peak\\n\""; +} else { + $rrd_options .= " COMMENT:\"".substr(str_pad($unit_text, $descr_len+5), 0, $descr_len+5)." Now Unique Average Peak\\n\""; +} + +foreach ($rrd_list as $rrd) +{ + $colours = (isset($rrd['colour']) ? $rrd['colour'] : "default"); + $strlen = ((strlen($rrd['descr'])<$descr_len) ? ($descr_len - strlen($rrd['descr'])) : "0"); + $descr = (isset($rrd['descr']) ? str_replace(":", "\:", substr(str_pad($rrd['descr'], $desc_len+$strlen), 0, $descr_len+$strlen)) : "Unkown"); + for ($z=0; $z<$strlen; $z++) { $descr .= " "; } + if ($i) { $stack = "STACK"; } + $colour = $config['graph_colours'][$colours][$x]; + $rrd_options .= " DEF:cur".$x."=".$rrd['filename'].":current:AVERAGE"; + $rrd_options .= " DEF:peak".$x."=".$rrd['filename'].":peak:MAX"; + $rrd_options .= " DEF:unique".$x."=".$rrd['filename'].":unique:AVERAGE"; + $rrd_options .= " VDEF:avg".$x."=cur".$x.",AVERAGE"; + $rrd_options .= " AREA:cur".$x."#".$colour.":\"".$descr."\":$stack"; + $rrd_options .= " GPRINT:cur".$x.":LAST:\"%6.2lf\""; + $rrd_options .= " GPRINT:unique".$x.":LAST:\"%6.2lf%s\""; + $rrd_options .= " GPRINT:avg".$x.":\"%6.2lf\""; + $rrd_options .= " GPRINT:peak".$x.":LAST:\"%6.2lf\""; + $rrd_options .= " COMMENT:\"\\n\""; + if ($x) + { + $totcur .= ",cur".$x.",+"; + $totpeak .= ",peak".$x.",+"; + $totunique .= ",unique".$x.",+"; } + $x = (($x diff --git a/html/includes/graphs/application/shoutcast_stats.inc.php b/html/includes/graphs/application/shoutcast_stats.inc.php index 7de4ddbefe..c383fc5ca7 100644 --- a/html/includes/graphs/application/shoutcast_stats.inc.php +++ b/html/includes/graphs/application/shoutcast_stats.inc.php @@ -1,42 +1,45 @@ = 355) { - $rrd_options .= " GPRINT:cur:LAST:\"\:%8.2lf\""; - $rrd_options .= " GPRINT:max:LAST:\"from%8.2lf\""; - $rrd_options .= " GPRINT:bitrate:LAST:\"(bitrate\:%8.2lf%s\""; - $rrd_options .= " COMMENT:\")\\n\""; - } else { - $rrd_options .= " GPRINT:cur:LAST:\"\:%8.2lf\\n\""; - } - $rrd_options .= " AREA:unique#AADEFEFF:\"Unique Listeners \""; - $rrd_options .= " GPRINT:unique:LAST:\"\:%8.2lf%s\\n\""; - $rrd_options .= " HRULE:avg#FF9000FF:\"Average Listeners\""; - $rrd_options .= " GPRINT:avg:\"\:%8.2lf\\n\""; - $rrd_options .= " LINE1:peak#C000FFFF:\"Peak Listeners \""; - $rrd_options .= " GPRINT:peak:LAST:\"\:%8.2lf\\n\""; - $rrd_options .= " TICK:stream_offline#B4FF00FF:1.0:\"Streaming client offline\\n\""; - $rrd_options .= " TICK:server_offline".$warn_colour_b."FF:1.0:\"Streaming server offline\""; +$rrd_options .= " DEF:cur=".$rrd_filename.":current:AVERAGE"; +$rrd_options .= " DEF:max=".$rrd_filename.":max:MAX"; +//$rrd_options .= " DEF:bit=".$rrd_filename.":bitrate:LAST"; +$rrd_options .= " DEF:bit=".$rrd_filename.":bitrate:MAX"; +$rrd_options .= " DEF:peak=".$rrd_filename.":peak:MAX"; +$rrd_options .= " DEF:unique=".$rrd_filename.":unique:AVERAGE"; +$rrd_options .= " DEF:status=".$rrd_filename.":status:AVERAGE"; +$rrd_options .= " CDEF:peakm=peak,1,-"; +$rrd_options .= " VDEF:avg=cur,AVERAGE"; +$rrd_options .= " VDEF:peakh=peakm,MAXIMUM"; +$rrd_options .= " CDEF:bitrate=bit,8,*"; +$rrd_options .= " CDEF:server=status,UN,1,0,IF"; +$rrd_options .= " CDEF:server_offline=status,1,LT,1,UNKN,IF"; +$rrd_options .= " CDEF:stream=max,UN,1,0,IF"; +$rrd_options .= " CDEF:stream_offline=max,1,LT,1,UNKN,IF"; +$rrd_options .= " AREA:cur#63C2FEFF:\"Current Listeners\""; + +if ($width >= 355) +{ + $rrd_options .= " GPRINT:cur:LAST:\"\:%8.2lf\""; + $rrd_options .= " GPRINT:max:LAST:\"from%8.2lf\""; + $rrd_options .= " GPRINT:bitrate:LAST:\"(bitrate\:%8.2lf%s\""; + $rrd_options .= " COMMENT:\")\\n\""; +} else { + $rrd_options .= " GPRINT:cur:LAST:\"\:%8.2lf\\n\""; +} + +$rrd_options .= " AREA:unique#AADEFEFF:\"Unique Listeners \""; +$rrd_options .= " GPRINT:unique:LAST:\"\:%8.2lf%s\\n\""; +$rrd_options .= " HRULE:avg#FF9000FF:\"Average Listeners\""; +$rrd_options .= " GPRINT:avg:\"\:%8.2lf\\n\""; +$rrd_options .= " LINE1:peak#C000FFFF:\"Peak Listeners \""; +$rrd_options .= " GPRINT:peak:LAST:\"\:%8.2lf\\n\""; +$rrd_options .= " TICK:stream_offline#B4FF00FF:1.0:\"Streaming client offline\\n\""; +$rrd_options .= " TICK:server_offline".$warn_colour_b."FF:1.0:\"Streaming server offline\""; ?> diff --git a/html/includes/graphs/device/smokeping_common.inc.php b/html/includes/graphs/device/smokeping_common.inc.php index e12ab5b93d..55d1cfbbf3 100644 --- a/html/includes/graphs/device/smokeping_common.inc.php +++ b/html/includes/graphs/device/smokeping_common.inc.php @@ -1,6 +1,6 @@ $rrd) $rrd_options .= " DEF:".$rrd['ds'].$i."=".$rrd['filename'].":".$rrd['ds'].":AVERAGE "; - if($simple_rrd) + if ($simple_rrd) { $rrd_options .= " CDEF:".$rrd['ds'].$i."min=".$rrd['ds'].$i." "; $rrd_options .= " CDEF:".$rrd['ds'].$i."max=".$rrd['ds'].$i." "; diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index a25965c033..2aee5fd04d 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -93,27 +93,32 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if(isset($config['smokeping']['dir'])) { - $smokeping_files = array(); - if ($handle = opendir($config['smokeping']['dir'])) { - while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != "..") { - if (eregi(".rrd", $file)) { - if (eregi("~", $file)) { - list($target,$slave) = explode("~", str_replace(".rrd", "", $file)); - $smokeping_files['in'][$target][$slave] = $file; - $smokeping_files['out'][$slave][$target] = $file; - } else { - $target = str_replace(".rrd", "", $file); - $smokeping_files['in'][$target][$config['own_hostname']] = $file; - $smokeping_files['out'][$config['own_hostname']][$target] = $file; - } - } + if (isset($config['smokeping']['dir'])) + { + $smokeping_files = array(); + if ($handle = opendir($config['smokeping']['dir'])) + { + while (false !== ($file = readdir($handle))) + { + if ($file != "." && $file != "..") + { + if (eregi(".rrd", $file)) + { + if (eregi("~", $file)) + { + list($target,$slave) = explode("~", str_replace(".rrd", "", $file)); + $smokeping_files['in'][$target][$slave] = $file; + $smokeping_files['out'][$slave][$target] = $file; + } else { + $target = str_replace(".rrd", "", $file); + $smokeping_files['in'][$target][$config['own_hostname']] = $file; + $smokeping_files['out'][$config['own_hostname']][$target] = $file; + } } + } } + } } - } - if (count($smokeping_files)) { diff --git a/html/pages/device/apps/shoutcast.inc.php b/html/pages/device/apps/shoutcast.inc.php index 0dfcfcb04b..12602b931e 100644 --- a/html/pages/device/apps/shoutcast.inc.php +++ b/html/pages/device/apps/shoutcast.inc.php @@ -1,62 +1,72 @@ 'Traffic Statistics - Total of all Shoutcast servers', - 'shoutcast_multi_stats' => 'Shoutcast Statistics - Total of all Shoutcast servers' - ); - foreach ($graphs as $key => $text) { - $graph_type = $key; - $graph_array['height'] = "100"; - $graph_array['width'] = "215"; - $graph_array['to'] = $now; - $graph_array['id'] = $app['app_id']; - $graph_array['type'] = "application_".$key; - echo('

'.$text.'

'); - echo(""); - include("includes/print-quadgraphs.inc.php"); - echo(""); - } - } +if (isset($total) && $total == true) +{ + $graphs = array( + 'shoutcast_multi_bits' => 'Traffic Statistics - Total of all Shoutcast servers', + 'shoutcast_multi_stats' => 'Shoutcast Statistics - Total of all Shoutcast servers' + ); - foreach ($files as $id=>$file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); - list($host, $port) = split('_', $hostname, 2); - $graphs = array( - 'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')', - 'shoutcast_stats' => 'Shoutcast Statistics - '.$host.' (Port: '.$port.')' - ); - foreach ($graphs as $key => $text) { - $graph_type = $key; - $graph_array['height'] = "100"; - $graph_array['width'] = "215"; - $graph_array['to'] = $now; - $graph_array['id'] = $app['app_id']; - $graph_array['type'] = "application_".$key; - $graph_array['hostname'] = $hostname; - echo('

'.$text.'

'); - echo(""); - include("includes/print-quadgraphs.inc.php"); - echo(""); - } - } + foreach ($graphs as $key => $text) + { + $graph_type = $key; + $graph_array['height'] = "100"; + $graph_array['width'] = "215"; + $graph_array['to'] = $now; + $graph_array['id'] = $app['app_id']; + $graph_array['type'] = "application_".$key; + echo('

'.$text.'

'); + echo(""); + include("includes/print-quadgraphs.inc.php"); + echo(""); + } +} + +foreach ($files as $id => $file) +{ + $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = eregi_replace('.rrd', '', $hostname); + list($host, $port) = split('_', $hostname, 2); + $graphs = array( + 'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')', + 'shoutcast_stats' => 'Shoutcast Statistics - '.$host.' (Port: '.$port.')' + ); + + foreach ($graphs as $key => $text) + { + $graph_type = $key; + $graph_array['height'] = "100"; + $graph_array['width'] = "215"; + $graph_array['to'] = $now; + $graph_array['id'] = $app['app_id']; + $graph_array['type'] = "application_".$key; + $graph_array['hostname'] = $hostname; + echo('

'.$text.'

'); + echo(""); + include("includes/print-quadgraphs.inc.php"); + echo(""); + } +} ?> \ No newline at end of file diff --git a/html/pages/device/latency.inc.php b/html/pages/device/latency.inc.php index 49305899b5..d26b437288 100644 --- a/html/pages/device/latency.inc.php +++ b/html/pages/device/latency.inc.php @@ -33,7 +33,7 @@ print_optionbar_end(); if($vars['view'] == "incoming") { - if(count($smokeping_files['in'][$device['hostname']])) + if (count($smokeping_files['in'][$device['hostname']])) { $graph_array['type'] = "device_smokeping_in_all"; @@ -45,7 +45,7 @@ if($vars['view'] == "incoming") } else { - if(count($smokeping_files['out'][$device['hostname']])) + if (count($smokeping_files['out'][$device['hostname']])) { $graph_array['type'] = "device_smokeping_out_all"; diff --git a/includes/polling/applications/apache.inc.php b/includes/polling/applications/apache.inc.php index f6efa79988..32aae69869 100644 --- a/includes/polling/applications/apache.inc.php +++ b/includes/polling/applications/apache.inc.php @@ -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"); diff --git a/includes/polling/applications/ntp-client.inc.php b/includes/polling/applications/ntp-client.inc.php index 8a6c5e701a..bd6cc0db08 100644 --- a/includes/polling/applications/ntp-client.inc.php +++ b/includes/polling/applications/ntp-client.inc.php @@ -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"); diff --git a/includes/polling/applications/ntpd-server.inc.php b/includes/polling/applications/ntpd-server.inc.php index feaf81b49a..f0dfd415db 100644 --- a/includes/polling/applications/ntpd-server.inc.php +++ b/includes/polling/applications/ntpd-server.inc.php @@ -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"); diff --git a/includes/polling/applications/powerdns.inc.php b/includes/polling/applications/powerdns.inc.php index 006945b6a2..be2c101a61 100644 --- a/includes/polling/applications/powerdns.inc.php +++ b/includes/polling/applications/powerdns.inc.php @@ -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"); diff --git a/includes/polling/applications/shoutcast.inc.php b/includes/polling/applications/shoutcast.inc.php index 113130990e..a2fc581eb5 100644 --- a/includes/polling/applications/shoutcast.inc.php +++ b/includes/polling/applications/shoutcast.inc.php @@ -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"); + } } ?>