diff --git a/html/includes/graphs/application/apache_bits.inc.php b/html/includes/graphs/application/apache_bits.inc.php
index d74b5fb87f..651e1c022c 100644
--- a/html/includes/graphs/application/apache_bits.inc.php
+++ b/html/includes/graphs/application/apache_bits.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$apache_rrd = rrd_name($device['hostname'], array('app', 'apache', $app['app_id']));
-if (is_file($apache_rrd)) {
+if (rrdtool_check_rrd_exists($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
diff --git a/html/includes/graphs/application/apache_cpu.inc.php b/html/includes/graphs/application/apache_cpu.inc.php
index e36b0fecbc..33c7561309 100644
--- a/html/includes/graphs/application/apache_cpu.inc.php
+++ b/html/includes/graphs/application/apache_cpu.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$apache_rrd = rrd_name($device['hostname'], array('app', 'apache', $app['app_id']));
-if (is_file($apache_rrd)) {
+if (rrdtool_check_rrd_exists($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
diff --git a/html/includes/graphs/application/apache_hits.inc.php b/html/includes/graphs/application/apache_hits.inc.php
index b5a0636225..9b4eb012a6 100644
--- a/html/includes/graphs/application/apache_hits.inc.php
+++ b/html/includes/graphs/application/apache_hits.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$apache_rrd = rrd_name($device['hostname'], array('app', 'apache', $app['app_id']));
-if (is_file($apache_rrd)) {
+if (rrdtool_check_rrd_exists($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
diff --git a/html/includes/graphs/application/apache_scoreboard.inc.php b/html/includes/graphs/application/apache_scoreboard.inc.php
index d8075c6978..aaf197ba04 100644
--- a/html/includes/graphs/application/apache_scoreboard.inc.php
+++ b/html/includes/graphs/application/apache_scoreboard.inc.php
@@ -50,7 +50,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/bind_queries.inc.php b/html/includes/graphs/application/bind_queries.inc.php
index 94625bef2d..9f3d0b1d84 100644
--- a/html/includes/graphs/application/bind_queries.inc.php
+++ b/html/includes/graphs/application/bind_queries.inc.php
@@ -48,7 +48,7 @@ $rrd_list = array();
$config['graph_colours']['merged'] = array_merge($config['graph_colours']['greens'], $config['graph_colours']['blues']);
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
diff --git a/html/includes/graphs/application/ceph_osd_performance.inc.php b/html/includes/graphs/application/ceph_osd_performance.inc.php
index 58381a9781..3427725b10 100644
--- a/html/includes/graphs/application/ceph_osd_performance.inc.php
+++ b/html/includes/graphs/application/ceph_osd_performance.inc.php
@@ -8,7 +8,7 @@ $out_text = 'Commit';
$ceph_osd_rrd = ceph_rrd('osd');
-if (is_file($ceph_osd_rrd)) {
+if (rrdtool_check_rrd_exists($ceph_osd_rrd)) {
$rrd_filename = $ceph_osd_rrd;
}
diff --git a/html/includes/graphs/application/ceph_pool_df.inc.php b/html/includes/graphs/application/ceph_pool_df.inc.php
index 4dbca16952..8b53d13523 100644
--- a/html/includes/graphs/application/ceph_pool_df.inc.php
+++ b/html/includes/graphs/application/ceph_pool_df.inc.php
@@ -4,7 +4,7 @@ require 'includes/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('df');
-if (is_file($ceph_pool_rrd)) {
+if (rrdtool_check_rrd_exists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;
}
diff --git a/html/includes/graphs/application/ceph_pool_io.inc.php b/html/includes/graphs/application/ceph_pool_io.inc.php
index 8b09856642..c33763d253 100644
--- a/html/includes/graphs/application/ceph_pool_io.inc.php
+++ b/html/includes/graphs/application/ceph_pool_io.inc.php
@@ -9,7 +9,7 @@ $format = 'bytes';
$ceph_pool_rrd = ceph_rrd('pool');
-if (is_file($ceph_pool_rrd)) {
+if (rrdtool_check_rrd_exists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;
}
diff --git a/html/includes/graphs/application/ceph_pool_iops.inc.php b/html/includes/graphs/application/ceph_pool_iops.inc.php
index 4ed81d3672..0f4e7b2324 100644
--- a/html/includes/graphs/application/ceph_pool_iops.inc.php
+++ b/html/includes/graphs/application/ceph_pool_iops.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('pool');
-if (is_file($ceph_pool_rrd)) {
+if (rrdtool_check_rrd_exists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;
}
diff --git a/html/includes/graphs/application/ceph_pool_objects.inc.php b/html/includes/graphs/application/ceph_pool_objects.inc.php
index c4f1389412..5d497869a4 100644
--- a/html/includes/graphs/application/ceph_pool_objects.inc.php
+++ b/html/includes/graphs/application/ceph_pool_objects.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('df');
-if (is_file($ceph_pool_rrd)) {
+if (rrdtool_check_rrd_exists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;
}
diff --git a/html/includes/graphs/application/drbd_disk_bits.inc.php b/html/includes/graphs/application/drbd_disk_bits.inc.php
index bc9961f51e..536cba013f 100644
--- a/html/includes/graphs/application/drbd_disk_bits.inc.php
+++ b/html/includes/graphs/application/drbd_disk_bits.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$drbd_rrd = rrd_name($device['hostname'], array('app', 'drbd', $app['app_instance']));
-if (is_file($drbd_rrd)) {
+if (rrdtool_check_rrd_exists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
diff --git a/html/includes/graphs/application/drbd_network_bits.inc.php b/html/includes/graphs/application/drbd_network_bits.inc.php
index ebd6bce27f..b3d1c35394 100644
--- a/html/includes/graphs/application/drbd_network_bits.inc.php
+++ b/html/includes/graphs/application/drbd_network_bits.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$drbd_rrd = rrd_name($device['hostname'], array('app', 'drbd', $app['app_instance']));
-if (is_file($drbd_rrd)) {
+if (rrdtool_check_rrd_exists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
diff --git a/html/includes/graphs/application/drbd_queue.inc.php b/html/includes/graphs/application/drbd_queue.inc.php
index 50237b4a12..3de7e66978 100644
--- a/html/includes/graphs/application/drbd_queue.inc.php
+++ b/html/includes/graphs/application/drbd_queue.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/drbd_unsynced.inc.php b/html/includes/graphs/application/drbd_unsynced.inc.php
index dd16019c22..686d56c40c 100644
--- a/html/includes/graphs/application/drbd_unsynced.inc.php
+++ b/html/includes/graphs/application/drbd_unsynced.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$drbd_rrd = rrd_name($device['hostname'], array('app', 'drbd', $app['app_instance']));
-if (is_file($drbd_rrd)) {
+if (rrdtool_check_rrd_exists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
diff --git a/html/includes/graphs/application/mailscanner_reject.inc.php b/html/includes/graphs/application/mailscanner_reject.inc.php
index 4ab82707fa..a4fd6d258a 100644
--- a/html/includes/graphs/application/mailscanner_reject.inc.php
+++ b/html/includes/graphs/application/mailscanner_reject.inc.php
@@ -16,7 +16,7 @@ $array = array(
$i = 0;
$x = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
$max_colours = count($config['graph_colours'][$colours]);
foreach ($array as $ds => $vars) {
$x = (($x <= $max_colours) ? $x : 0);
diff --git a/html/includes/graphs/application/mailscanner_sent.inc.php b/html/includes/graphs/application/mailscanner_sent.inc.php
index 2a19397357..3e2728e1b9 100644
--- a/html/includes/graphs/application/mailscanner_sent.inc.php
+++ b/html/includes/graphs/application/mailscanner_sent.inc.php
@@ -17,7 +17,7 @@ $colour_area_out_max = 'FFEFAA';
$mailscanner_rrd = rrd_name($device['hostname'], array('app', 'mailscannerV2', $app['app_id']));
-if (is_file($mailscanner_rrd)) {
+if (rrdtool_check_rrd_exists($mailscanner_rrd)) {
$rrd_filename = $mailscanner_rrd;
}
diff --git a/html/includes/graphs/application/mailscanner_spam.inc.php b/html/includes/graphs/application/mailscanner_spam.inc.php
index bb805addf2..ecad7e0948 100644
--- a/html/includes/graphs/application/mailscanner_spam.inc.php
+++ b/html/includes/graphs/application/mailscanner_spam.inc.php
@@ -19,7 +19,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/memcached.inc.php b/html/includes/graphs/application/memcached.inc.php
index 5bd7e7bb27..880ea912d1 100644
--- a/html/includes/graphs/application/memcached.inc.php
+++ b/html/includes/graphs/application/memcached.inc.php
@@ -1,5 +1,5 @@
$vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/memcached_hitmiss.inc.php b/html/includes/graphs/application/memcached_hitmiss.inc.php
index f781224ee0..575a360819 100644
--- a/html/includes/graphs/application/memcached_hitmiss.inc.php
+++ b/html/includes/graphs/application/memcached_hitmiss.inc.php
@@ -20,7 +20,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/memcached_items.inc.php b/html/includes/graphs/application/memcached_items.inc.php
index 067c6496ce..17352ab14d 100644
--- a/html/includes/graphs/application/memcached_items.inc.php
+++ b/html/includes/graphs/application/memcached_items.inc.php
@@ -16,7 +16,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/mysql_command_counters.inc.php b/html/includes/graphs/application/mysql_command_counters.inc.php
index 258594fc98..7d3047e051 100644
--- a/html/includes/graphs/application/mysql_command_counters.inc.php
+++ b/html/includes/graphs/application/mysql_command_counters.inc.php
@@ -44,7 +44,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/mysql_connections.inc.php b/html/includes/graphs/application/mysql_connections.inc.php
index b74234a676..45f577448f 100644
--- a/html/includes/graphs/application/mysql_connections.inc.php
+++ b/html/includes/graphs/application/mysql_connections.inc.php
@@ -34,7 +34,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/mysql_files_tables.inc.php b/html/includes/graphs/application/mysql_files_tables.inc.php
index 40cc28578d..0fbe86de3f 100644
--- a/html/includes/graphs/application/mysql_files_tables.inc.php
+++ b/html/includes/graphs/application/mysql_files_tables.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/mysql_innodb_buffer_pool.inc.php b/html/includes/graphs/application/mysql_innodb_buffer_pool.inc.php
index 5b1478e9d7..9e35ca9664 100644
--- a/html/includes/graphs/application/mysql_innodb_buffer_pool.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_buffer_pool.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php b/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php
index ba6bc1af5e..19275feae3 100644
--- a/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php
@@ -11,7 +11,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php b/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php
index 51256965e5..0d83b6633e 100644
--- a/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php
@@ -11,7 +11,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_io.inc.php b/html/includes/graphs/application/mysql_innodb_io.inc.php
index 5f2ca64c58..cbc4f019ea 100644
--- a/html/includes/graphs/application/mysql_innodb_io.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_io.inc.php
@@ -4,7 +4,7 @@ require 'includes/graphs/common.inc.php';
$mysql_rrd = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id']));
-if (is_file($mysql_rrd)) {
+if (rrdtool_check_rrd_exists($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
diff --git a/html/includes/graphs/application/mysql_innodb_io_pending.inc.php b/html/includes/graphs/application/mysql_innodb_io_pending.inc.php
index 3cd0d7f325..f2ecc3d484 100644
--- a/html/includes/graphs/application/mysql_innodb_io_pending.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_io_pending.inc.php
@@ -15,7 +15,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_log.inc.php b/html/includes/graphs/application/mysql_innodb_log.inc.php
index ade5e47f4a..cb20abebc3 100644
--- a/html/includes/graphs/application/mysql_innodb_log.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_log.inc.php
@@ -4,7 +4,7 @@ require 'includes/graphs/common.inc.php';
$mysql_rrd = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id']));
-if (is_file($mysql_rrd)) {
+if (rrdtool_check_rrd_exists($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
diff --git a/html/includes/graphs/application/mysql_innodb_row_operations.inc.php b/html/includes/graphs/application/mysql_innodb_row_operations.inc.php
index c5ab9cda44..3aea791645 100644
--- a/html/includes/graphs/application/mysql_innodb_row_operations.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_row_operations.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_semaphores.inc.php b/html/includes/graphs/application/mysql_innodb_semaphores.inc.php
index 8a27ef1bc9..f8499e5728 100644
--- a/html/includes/graphs/application/mysql_innodb_semaphores.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_semaphores.inc.php
@@ -11,7 +11,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_innodb_transactions.inc.php b/html/includes/graphs/application/mysql_innodb_transactions.inc.php
index 04cde3a191..307c4e74cf 100644
--- a/html/includes/graphs/application/mysql_innodb_transactions.inc.php
+++ b/html/includes/graphs/application/mysql_innodb_transactions.inc.php
@@ -7,7 +7,7 @@ $rrd_filename = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id
$array = array('IBTNx' => 'Transactions created');
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_myisam_indexes.inc.php b/html/includes/graphs/application/mysql_myisam_indexes.inc.php
index c95b316dbc..5fdff1cee2 100644
--- a/html/includes/graphs/application/mysql_myisam_indexes.inc.php
+++ b/html/includes/graphs/application/mysql_myisam_indexes.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_network_traffic.inc.php b/html/includes/graphs/application/mysql_network_traffic.inc.php
index afabd03cac..2674439a75 100644
--- a/html/includes/graphs/application/mysql_network_traffic.inc.php
+++ b/html/includes/graphs/application/mysql_network_traffic.inc.php
@@ -4,7 +4,7 @@ require 'includes/graphs/common.inc.php';
$mysql_rrd = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id']));
-if (is_file($mysql_rrd)) {
+if (rrdtool_check_rrd_exists($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
diff --git a/html/includes/graphs/application/mysql_query_cache.inc.php b/html/includes/graphs/application/mysql_query_cache.inc.php
index c1b76eeb36..9a70d720aa 100644
--- a/html/includes/graphs/application/mysql_query_cache.inc.php
+++ b/html/includes/graphs/application/mysql_query_cache.inc.php
@@ -4,45 +4,45 @@ require 'includes/graphs/common.inc.php';
$mysql_rrd = rrd_name($device['hostname'], array('app', mysql, $app['app_id']));
-if (is_file($mysql_rrd)) {
+if (rrdtool_check_rrd_exists($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
-}
-$array = array(
- 'QCQICe' => array(
- 'descr' => 'Queries in cache',
- 'colour' => '22FF22',
- ),
- 'QCHs' => array(
- 'descr' => 'Cache hits',
- 'colour' => '0022FF',
- ),
- 'QCIs' => array(
- 'descr' => 'Inserts',
- 'colour' => 'FF0000',
- ),
- 'QCNCd' => array(
- 'descr' => 'Not cached',
- 'colour' => '00AAAA',
- ),
- 'QCLMPs' => array(
- 'descr' => 'Low-memory prunes',
- 'colour' => 'FF00FF',
- ),
- );
+ $array = array(
+ 'QCQICe' => array(
+ 'descr' => 'Queries in cache',
+ 'colour' => '22FF22',
+ ),
+ 'QCHs' => array(
+ 'descr' => 'Cache hits',
+ 'colour' => '0022FF',
+ ),
+ 'QCIs' => array(
+ 'descr' => 'Inserts',
+ 'colour' => 'FF0000',
+ ),
+ 'QCNCd' => array(
+ 'descr' => 'Not cached',
+ 'colour' => '00AAAA',
+ ),
+ 'QCLMPs' => array(
+ 'descr' => 'Low-memory prunes',
+ 'colour' => 'FF00FF',
+ ),
+ );
-$i = 0;
-if (is_file($rrd_filename)) {
+
+ $rrd_list = array();
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++;
+ $rrd_list[] = array(
+ 'filename' => $rrd_filename,
+ 'descr' => $vars['descr'],
+ 'ds' => $ds,
+// 'colour' => $vars['colour']
+ );
}
}
else {
- echo "file missing: $file";
+ echo "data missing: $mysql_rrd";
}
$colours = 'mixed';
diff --git a/html/includes/graphs/application/mysql_query_cache_memory.inc.php b/html/includes/graphs/application/mysql_query_cache_memory.inc.php
index 6343ed214d..e003857307 100644
--- a/html/includes/graphs/application/mysql_query_cache_memory.inc.php
+++ b/html/includes/graphs/application/mysql_query_cache_memory.inc.php
@@ -10,7 +10,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_select_types.inc.php b/html/includes/graphs/application/mysql_select_types.inc.php
index e7d81dab0b..b78e354937 100644
--- a/html/includes/graphs/application/mysql_select_types.inc.php
+++ b/html/includes/graphs/application/mysql_select_types.inc.php
@@ -13,7 +13,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_slow_queries.inc.php b/html/includes/graphs/application/mysql_slow_queries.inc.php
index a70a28a369..2827a3c6dc 100644
--- a/html/includes/graphs/application/mysql_slow_queries.inc.php
+++ b/html/includes/graphs/application/mysql_slow_queries.inc.php
@@ -7,7 +7,7 @@ $rrd_filename = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id
$array = array('SQs' => 'Slow queries');
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_sorts.inc.php b/html/includes/graphs/application/mysql_sorts.inc.php
index c2df2b06a7..84abb295b8 100644
--- a/html/includes/graphs/application/mysql_sorts.inc.php
+++ b/html/includes/graphs/application/mysql_sorts.inc.php
@@ -12,7 +12,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_status.inc.php b/html/includes/graphs/application/mysql_status.inc.php
index f74364d698..1bdd727c00 100644
--- a/html/includes/graphs/application/mysql_status.inc.php
+++ b/html/includes/graphs/application/mysql_status.inc.php
@@ -24,7 +24,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $vars => $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_table_locks.inc.php b/html/includes/graphs/application/mysql_table_locks.inc.php
index f2b7a7a136..d575e157ba 100644
--- a/html/includes/graphs/application/mysql_table_locks.inc.php
+++ b/html/includes/graphs/application/mysql_table_locks.inc.php
@@ -10,7 +10,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/mysql_temporary_objects.inc.php b/html/includes/graphs/application/mysql_temporary_objects.inc.php
index fc1ef90f40..654e43bc1f 100644
--- a/html/includes/graphs/application/mysql_temporary_objects.inc.php
+++ b/html/includes/graphs/application/mysql_temporary_objects.inc.php
@@ -11,7 +11,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
diff --git a/html/includes/graphs/application/nginx_connections.inc.php b/html/includes/graphs/application/nginx_connections.inc.php
index 1339ec64f7..4926443c3d 100644
--- a/html/includes/graphs/application/nginx_connections.inc.php
+++ b/html/includes/graphs/application/nginx_connections.inc.php
@@ -26,7 +26,7 @@ $array = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/nginx_req.inc.php b/html/includes/graphs/application/nginx_req.inc.php
index 7d3761380a..bb4d2502eb 100644
--- a/html/includes/graphs/application/nginx_req.inc.php
+++ b/html/includes/graphs/application/nginx_req.inc.php
@@ -4,7 +4,7 @@ require 'includes/graphs/common.inc.php';
$rrd_filename = rrd_name($device['hostname'], array('app', 'nginx', $app['app_id']));
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_options .= ' -b 1000 ';
$rrd_options .= ' -l 0 ';
$rrd_options .= ' DEF:a='.$rrd_filename.':Requests:AVERAGE';
diff --git a/html/includes/graphs/application/ntpclient_freq.inc.php b/html/includes/graphs/application/ntpclient_freq.inc.php
index 180dbc3c62..cfd0430b28 100644
--- a/html/includes/graphs/application/ntpclient_freq.inc.php
+++ b/html/includes/graphs/application/ntpclient_freq.inc.php
@@ -11,7 +11,7 @@ $graph_max = 100;
$unit_text = 'Frequency';
$ntpclient_rrd = rrd_name($device['hostname'], array('app', 'ntpclient', $app['app_id']));
-if (is_file($ntpclient_rrd)) {
+if (rrdtool_check_rrd_exists($ntpclient_rrd)) {
$rrd_filename = $ntpclient_rrd;
}
diff --git a/html/includes/graphs/application/ntpclient_stats.inc.php b/html/includes/graphs/application/ntpclient_stats.inc.php
index 6118f75cd9..1ee5672047 100644
--- a/html/includes/graphs/application/ntpclient_stats.inc.php
+++ b/html/includes/graphs/application/ntpclient_stats.inc.php
@@ -15,7 +15,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/ntpdserver_bits.inc.php b/html/includes/graphs/application/ntpdserver_bits.inc.php
index 9b7996d7ab..f238dfd0f3 100644
--- a/html/includes/graphs/application/ntpdserver_bits.inc.php
+++ b/html/includes/graphs/application/ntpdserver_bits.inc.php
@@ -22,7 +22,7 @@ $colour_area_out_max = 'FFEFAA';
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
-if (is_file($ntpdserver_rrd)) {
+if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
diff --git a/html/includes/graphs/application/ntpdserver_buffer.inc.php b/html/includes/graphs/application/ntpdserver_buffer.inc.php
index 7e10be0bda..b0e81ef713 100644
--- a/html/includes/graphs/application/ntpdserver_buffer.inc.php
+++ b/html/includes/graphs/application/ntpdserver_buffer.inc.php
@@ -15,7 +15,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/ntpdserver_freq.inc.php b/html/includes/graphs/application/ntpdserver_freq.inc.php
index ac141364a8..59f6f12f86 100644
--- a/html/includes/graphs/application/ntpdserver_freq.inc.php
+++ b/html/includes/graphs/application/ntpdserver_freq.inc.php
@@ -11,7 +11,7 @@ $graph_max = 100;
$unit_text = 'Frequency';
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
-if (is_file($ntpdserver_rrd)) {
+if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
diff --git a/html/includes/graphs/application/ntpdserver_packets.inc.php b/html/includes/graphs/application/ntpdserver_packets.inc.php
index 55440924af..e884c5c3bd 100644
--- a/html/includes/graphs/application/ntpdserver_packets.inc.php
+++ b/html/includes/graphs/application/ntpdserver_packets.inc.php
@@ -19,7 +19,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/ntpdserver_stats.inc.php b/html/includes/graphs/application/ntpdserver_stats.inc.php
index ec411bce06..362f19e06e 100644
--- a/html/includes/graphs/application/ntpdserver_stats.inc.php
+++ b/html/includes/graphs/application/ntpdserver_stats.inc.php
@@ -15,7 +15,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/ntpdserver_stratum.inc.php b/html/includes/graphs/application/ntpdserver_stratum.inc.php
index 0016db50c5..aaf92c0287 100644
--- a/html/includes/graphs/application/ntpdserver_stratum.inc.php
+++ b/html/includes/graphs/application/ntpdserver_stratum.inc.php
@@ -11,7 +11,7 @@ $graph_max = 0;
$unit_text = 'Stratum';
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
-if (is_file($ntpdserver_rrd)) {
+if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
diff --git a/html/includes/graphs/application/ntpdserver_uptime.inc.php b/html/includes/graphs/application/ntpdserver_uptime.inc.php
index 8ea5f1cb73..a4baf8b03d 100644
--- a/html/includes/graphs/application/ntpdserver_uptime.inc.php
+++ b/html/includes/graphs/application/ntpdserver_uptime.inc.php
@@ -13,7 +13,7 @@ $graph_max = 0;
$unit_text = 'Seconds';
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
-if (is_file($ntpdserver_rrd)) {
+if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
diff --git a/html/includes/graphs/application/powerdns_fail.inc.php b/html/includes/graphs/application/powerdns_fail.inc.php
index e9c623a283..87b886e3bf 100644
--- a/html/includes/graphs/application/powerdns_fail.inc.php
+++ b/html/includes/graphs/application/powerdns_fail.inc.php
@@ -24,7 +24,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/powerdns_latency.inc.php b/html/includes/graphs/application/powerdns_latency.inc.php
index f8f1118808..5c22012f05 100644
--- a/html/includes/graphs/application/powerdns_latency.inc.php
+++ b/html/includes/graphs/application/powerdns_latency.inc.php
@@ -11,7 +11,7 @@ $graph_max = 100;
$unit_text = 'Latency';
$powerdns_rrd = rrd_name($device['hostname'], array('app', 'powerdns', $app['app_id']));
-if (is_file($powerdns_rrd)) {
+if (rrdtool_check_rrd_exists($powerdns_rrd)) {
$rrd_filename = $powerdns_rrd;
}
diff --git a/html/includes/graphs/application/powerdns_packetcache.inc.php b/html/includes/graphs/application/powerdns_packetcache.inc.php
index bfdf689da3..c0498748ea 100644
--- a/html/includes/graphs/application/powerdns_packetcache.inc.php
+++ b/html/includes/graphs/application/powerdns_packetcache.inc.php
@@ -24,7 +24,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/powerdns_queries.inc.php b/html/includes/graphs/application/powerdns_queries.inc.php
index 27f65eb058..37cc95eb28 100644
--- a/html/includes/graphs/application/powerdns_queries.inc.php
+++ b/html/includes/graphs/application/powerdns_queries.inc.php
@@ -28,7 +28,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/powerdns_queries_udp.inc.php b/html/includes/graphs/application/powerdns_queries_udp.inc.php
index a009ab60b6..a4cf32a0cb 100644
--- a/html/includes/graphs/application/powerdns_queries_udp.inc.php
+++ b/html/includes/graphs/application/powerdns_queries_udp.inc.php
@@ -28,7 +28,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/powerdns_querycache.inc.php b/html/includes/graphs/application/powerdns_querycache.inc.php
index 03b424cefb..82f5dcd12e 100644
--- a/html/includes/graphs/application/powerdns_querycache.inc.php
+++ b/html/includes/graphs/application/powerdns_querycache.inc.php
@@ -20,7 +20,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/powerdns_recursing.inc.php b/html/includes/graphs/application/powerdns_recursing.inc.php
index 47562e1ad6..ad0a33e7cd 100644
--- a/html/includes/graphs/application/powerdns_recursing.inc.php
+++ b/html/includes/graphs/application/powerdns_recursing.inc.php
@@ -20,7 +20,7 @@ $array = array(
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
diff --git a/html/includes/graphs/application/proxmox_traffic.inc.php b/html/includes/graphs/application/proxmox_traffic.inc.php
index 8d3b790fc7..09b7cdb084 100644
--- a/html/includes/graphs/application/proxmox_traffic.inc.php
+++ b/html/includes/graphs/application/proxmox_traffic.inc.php
@@ -20,7 +20,7 @@ require 'includes/graphs/common.inc.php';
$proxmox_rrd = config['rrd_dir'].'/proxmox/'.$vars['cluster'].'/'.$vars['vmid'].'_netif_'.$vars['port'].'.rrd';
-if (is_file($proxmox_rrd)) {
+if (rrdtool_check_rrd_exists($proxmox_rrd)) {
$rrd_filename = $proxmox_rrd;
}
diff --git a/html/includes/graphs/application/rrdcached.inc.php b/html/includes/graphs/application/rrdcached.inc.php
index 8d16005b81..eda711768a 100644
--- a/html/includes/graphs/application/rrdcached.inc.php
+++ b/html/includes/graphs/application/rrdcached.inc.php
@@ -24,6 +24,6 @@
*/
$rrd = rrd_name($device['hostname'], array('app', 'rrdcached', $app['app_id']));
-if (is_file($rrd)) {
+if (rrdtool_check_rrd_exists($rrd)) {
$rrd_filename = $rrd;
}
diff --git a/html/includes/graphs/application/tinydns_dnssec.inc.php b/html/includes/graphs/application/tinydns_dnssec.inc.php
index cae12cae9f..43f96701f4 100644
--- a/html/includes/graphs/application/tinydns_dnssec.inc.php
+++ b/html/includes/graphs/application/tinydns_dnssec.inc.php
@@ -39,7 +39,7 @@ $array = array(
$colours = 'mixed';
$rrd_list = array();
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
diff --git a/html/includes/graphs/application/tinydns_errors.inc.php b/html/includes/graphs/application/tinydns_errors.inc.php
index 04ffd5863e..e6a1be554b 100644
--- a/html/includes/graphs/application/tinydns_errors.inc.php
+++ b/html/includes/graphs/application/tinydns_errors.inc.php
@@ -40,7 +40,7 @@ $array = array(
$colours = 'oranges';
$rrd_list = array();
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
diff --git a/html/includes/graphs/application/tinydns_other.inc.php b/html/includes/graphs/application/tinydns_other.inc.php
index 1525ab784b..c18cd6cbf2 100644
--- a/html/includes/graphs/application/tinydns_other.inc.php
+++ b/html/includes/graphs/application/tinydns_other.inc.php
@@ -40,7 +40,7 @@ $array = array(
$colours = 'mixed';
$rrd_list = array();
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
diff --git a/html/includes/graphs/application/tinydns_queries.inc.php b/html/includes/graphs/application/tinydns_queries.inc.php
index 10a438fb99..a256bbb4e6 100644
--- a/html/includes/graphs/application/tinydns_queries.inc.php
+++ b/html/includes/graphs/application/tinydns_queries.inc.php
@@ -48,7 +48,7 @@ $rrd_list = array();
$config['graph_colours']['merged'] = array_merge($config['graph_colours']['greens'], $config['graph_colours']['blues']);
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
diff --git a/html/includes/graphs/bill/bits.inc.php b/html/includes/graphs/bill/bits.inc.php
index 266fa86a21..4feafc3ef5 100644
--- a/html/includes/graphs/bill/bits.inc.php
+++ b/html/includes/graphs/bill/bits.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach ($ports as $port) {
$rrd_file = get_port_rrdfile_path ($port['hostname'], $port['port_id']);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_list[$i]['filename'] = $rrd_file;
$rrd_list[$i]['descr'] = $port['ifDescr'];
$i++;
diff --git a/html/includes/graphs/cefswitching/graph.inc.php b/html/includes/graphs/cefswitching/graph.inc.php
index 5a1b31419d..28e1e81261 100644
--- a/html/includes/graphs/cefswitching/graph.inc.php
+++ b/html/includes/graphs/cefswitching/graph.inc.php
@@ -8,7 +8,7 @@ $oids = array(
);
$i = 0;
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($oids as $oid) {
$oid = str_replace('dot3Stats', '', $oid);
$oid_ds = truncate($oid, 19, '');
diff --git a/html/includes/graphs/customer/bits.inc.php b/html/includes/graphs/customer/bits.inc.php
index ee3d4a7411..46d3046ad2 100644
--- a/html/includes/graphs/customer/bits.inc.php
+++ b/html/includes/graphs/customer/bits.inc.php
@@ -11,7 +11,7 @@ $descr_type = "'".implode("', '", $config['customers_descr'])."'";
foreach (dbFetchRows('SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` IN (?) AND `port_descr_descr` = ? AND D.device_id = I.device_id', array(array($descr_type), $vars['id'])) as $port) {
$rrd_filename = get_port_rrdfile_path ($port['hostname'], $port['port_id']); // FIXME: Unification OK?
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $port['hostname'].'-'.$port['ifDescr'];
$rrd_list[$i]['descr_in'] = shorthost($port['hostname']);
diff --git a/html/includes/graphs/device/agent.inc.php b/html/includes/graphs/device/agent.inc.php
index d774097397..67fd78a275 100644
--- a/html/includes/graphs/device/agent.inc.php
+++ b/html/includes/graphs/device/agent.inc.php
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
$agent_rrd = rrd_name($device['hostname'], 'agent');
-if (is_file($agent_rrd)) {
+if (rrdtool_check_rrd_exists($agent_rrd)) {
$rrd_filename = $agent_rrd;
}
diff --git a/html/includes/graphs/device/bits.inc.php b/html/includes/graphs/device/bits.inc.php
index f796490f2c..166743621e 100644
--- a/html/includes/graphs/device/bits.inc.php
+++ b/html/includes/graphs/device/bits.inc.php
@@ -23,7 +23,7 @@ foreach (dbFetchRows('SELECT * FROM `ports` WHERE `device_id` = ?', array($devic
}
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id']);
- if ($ignore != 1 && is_file($rrd_filename)) {
+ if ($ignore != 1 && rrdtool_check_rrd_exists($rrd_filename)) {
$port = ifLabel($port);
// Fix Labels! ARGH. This needs to be in the bloody database!
$rrd_filenames[] = $rrd_filename;
diff --git a/html/includes/graphs/device/diskio_common.inc.php b/html/includes/graphs/device/diskio_common.inc.php
index b5e503e07d..16f3d450ce 100644
--- a/html/includes/graphs/device/diskio_common.inc.php
+++ b/html/includes/graphs/device/diskio_common.inc.php
@@ -4,7 +4,7 @@ $i = 1;
foreach (dbFetchRows('SELECT * FROM `ucd_diskio` AS U, `devices` AS D WHERE D.device_id = ? AND U.device_id = D.device_id', array($device['device_id'])) as $disk) {
$rrd_filename = rrd_name($disk['hostname'], array('ucd_diskio', $disk['diskio_descr']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $disk['diskio_descr'];
$rrd_list[$i]['ds_in'] = $ds_in;
diff --git a/html/includes/graphs/device/mempool.inc.php b/html/includes/graphs/device/mempool.inc.php
index eeb86abe23..4b770b33c2 100644
--- a/html/includes/graphs/device/mempool.inc.php
+++ b/html/includes/graphs/device/mempool.inc.php
@@ -36,7 +36,7 @@ foreach (dbFetchRows('SELECT * FROM `mempools` where `device_id` = ?', array($de
$descr = rrdtool_escape(short_hrDeviceDescr($mempool['mempool_descr']), 22);
$rrd_filename = rrd_name($device['hostname'], array('mempool', $mempool['mempool_type'], $mempool['mempool_index']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_options .= " DEF:mempoolfree$i=$rrd_filename:free:AVERAGE ";
$rrd_options .= " DEF:mempoolused$i=$rrd_filename:used:AVERAGE ";
$rrd_options .= " CDEF:mempooltotal$i=mempoolused$i,mempoolused$i,mempoolfree$i,+,/,100,* ";
diff --git a/html/includes/graphs/device/poller_modules_perf.inc.php b/html/includes/graphs/device/poller_modules_perf.inc.php
index 50ca7fcf4b..a83080b437 100644
--- a/html/includes/graphs/device/poller_modules_perf.inc.php
+++ b/html/includes/graphs/device/poller_modules_perf.inc.php
@@ -22,7 +22,7 @@ $count = 0;
foreach ($config['poller_modules'] as $module => $module_status) {
$rrd_filename = rrd_name($device['hostname'], array('poller-perf', $module));
if ($attribs['poll_'.$module] || ( $module_status && !isset($attribs['poll_'.$module]))) {
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$ds['ds'] = 'poller';
$ds['descr'] = $module;
$ds['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/device/processor_separate.inc.php b/html/includes/graphs/device/processor_separate.inc.php
index bf77508763..5607688699 100644
--- a/html/includes/graphs/device/processor_separate.inc.php
+++ b/html/includes/graphs/device/processor_separate.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach ($procs as $proc) {
$rrd_filename = rrd_name($device['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$descr = short_hrDeviceDescr($proc['processor_descr']);
$rrd_list[$i]['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/device/processor_stack.inc.php b/html/includes/graphs/device/processor_stack.inc.php
index 6e3df921a6..5397b8fa10 100644
--- a/html/includes/graphs/device/processor_stack.inc.php
+++ b/html/includes/graphs/device/processor_stack.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach ($procs as $proc) {
$rrd_filename = rrd_name($device['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$descr = short_hrDeviceDescr($proc['processor_descr']);
$rrd_list[$i]['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/global/bits.inc.php b/html/includes/graphs/global/bits.inc.php
index 350d96f870..3cb29a96ad 100644
--- a/html/includes/graphs/global/bits.inc.php
+++ b/html/includes/graphs/global/bits.inc.php
@@ -22,7 +22,7 @@ foreach (dbFetchRows('SELECT * FROM `ports` AS P, `devices` AS D WHERE D.device_
}
$rrd_filename = get_port_rrdfile_path ($port['hostname'], $port['port_id']);
- if (!$ignore && $i < 1100 && is_file($rrd_filename)) {
+ if (!$ignore && $i < 1100 && rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename;
// $rrd_list[$i]['descr'] = $port['device_id'] . " " . $port['ifDescr'];
diff --git a/html/includes/graphs/global/processor_separate.inc.php b/html/includes/graphs/global/processor_separate.inc.php
index e68547523d..9c3003eeb8 100644
--- a/html/includes/graphs/global/processor_separate.inc.php
+++ b/html/includes/graphs/global/processor_separate.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach (dbFetchRows('SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id') as $proc) {
$rrd_filename = rrd_name($proc['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$descr = short_hrDeviceDescr($proc['processor_descr']);
$rrd_list[$i]['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/global/processor_stack.inc.php b/html/includes/graphs/global/processor_stack.inc.php
index da0919e984..9b73cc7f63 100644
--- a/html/includes/graphs/global/processor_stack.inc.php
+++ b/html/includes/graphs/global/processor_stack.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach (dbFetchRows('SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id') as $proc) {
$rrd_filename = rrd_name($proc['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
- if (is_file($rrd_filename)) {
+ if (rrdtool_check_rrd_exists($rrd_filename)) {
$descr = short_hrDeviceDescr($proc['processor_descr']);
$rrd_list[$i]['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/location/bits.inc.php b/html/includes/graphs/location/bits.inc.php
index 7f77108a92..100745630d 100644
--- a/html/includes/graphs/location/bits.inc.php
+++ b/html/includes/graphs/location/bits.inc.php
@@ -25,7 +25,7 @@ foreach ($devices as $device) {
}
$rrd_file = get_port_rrdfile_path ($device['hostname'], $int['port_id']);
- if (is_file($rrd_file) && $ignore != 1) {
+ if (rrdtool_check_rrd_exists($rrd_file) && $ignore != 1) {
$rrd_filename = $rrd_file; // FIXME: Can this be unified without side-effects?
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $port['label'];
diff --git a/html/includes/graphs/multiport/bits.inc.php b/html/includes/graphs/multiport/bits.inc.php
index e64e39b314..06a8810397 100644
--- a/html/includes/graphs/multiport/bits.inc.php
+++ b/html/includes/graphs/multiport/bits.inc.php
@@ -10,7 +10,7 @@ foreach (explode(',', $vars['id']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_filenames[$i] = $rrd_file;
$i++;
}
diff --git a/html/includes/graphs/multiport/bits_duo.inc.php b/html/includes/graphs/multiport/bits_duo.inc.php
index cc9892dde7..4d3b0817c0 100644
--- a/html/includes/graphs/multiport/bits_duo.inc.php
+++ b/html/includes/graphs/multiport/bits_duo.inc.php
@@ -15,7 +15,7 @@ $i = 1;
foreach (explode(',', $_GET['id']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_options .= ' DEF:inoctets'.$i.'='.$rrd_file.':INOCTETS:AVERAGE';
$rrd_options .= ' DEF:outoctets'.$i.'='.$rrd_file.':OUTOCTETS:AVERAGE';
$in_thing .= $seperator.'inoctets'.$i.',UN,0,'.'inoctets'.$i.',IF';
@@ -33,7 +33,7 @@ unset($plus);
foreach (explode(',', $_GET['idb']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_options .= ' DEF:inoctetsb'.$i.'='.$rrd_file.':INOCTETS:AVERAGE';
$rrd_options .= ' DEF:outoctetsb'.$i.'='.$rrd_file.':OUTOCTETS:AVERAGE';
$in_thingb .= $seperator.'inoctetsb'.$i.',UN,0,'.'inoctetsb'.$i.',IF';
diff --git a/html/includes/graphs/multiport/bits_separate.inc.php b/html/includes/graphs/multiport/bits_separate.inc.php
index 980386286b..12e1c78de4 100644
--- a/html/includes/graphs/multiport/bits_separate.inc.php
+++ b/html/includes/graphs/multiport/bits_separate.inc.php
@@ -5,7 +5,7 @@ $i = 0;
foreach (explode(',', $vars['id']) as $ifid) {
$port = dbFetchRow('SELECT * FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($port['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$port = ifLabel($port);
$rrd_list[$i]['filename'] = $rrd_file;
$rrd_list[$i]['descr'] = $port['hostname'].' '.$port['ifDescr'];
diff --git a/html/includes/graphs/multiport/bits_trio.inc.php b/html/includes/graphs/multiport/bits_trio.inc.php
index 563ae1b9b0..8483ed1c87 100644
--- a/html/includes/graphs/multiport/bits_trio.inc.php
+++ b/html/includes/graphs/multiport/bits_trio.inc.php
@@ -16,7 +16,7 @@ $i = 1;
foreach (explode(',', $_GET['id']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
if (strstr($inverse, 'a')) {
$in = 'OUT';
$out = 'IN';
@@ -43,7 +43,7 @@ unset($plus);
foreach (explode(',', $_GET['idb']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
if (strstr($inverse, 'b')) {
$in = 'OUT';
$out = 'IN';
@@ -70,7 +70,7 @@ unset($plus);
foreach (explode(',', $_GET['idc']) as $ifid) {
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', array($ifid));
$rrd_file = get_port_rrdfile_path ($int['hostname'], $ifid);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
if (strstr($inverse, 'c')) {
$in = 'OUT';
$out = 'IN';
diff --git a/html/includes/graphs/port/etherlike.inc.php b/html/includes/graphs/port/etherlike.inc.php
index 86475f73f0..8c6643b189 100644
--- a/html/includes/graphs/port/etherlike.inc.php
+++ b/html/includes/graphs/port/etherlike.inc.php
@@ -20,7 +20,7 @@ $oids = array(
$i = 0;
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'dot3');
-if (is_file($rrd_filename)) {
+if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($oids as $oid) {
$oid = str_replace('dot3Stats', '', $oid);
$oid_ds = truncate($oid, 19, '');
diff --git a/html/includes/graphs/port/mac_acc_total.inc.php b/html/includes/graphs/port/mac_acc_total.inc.php
index e5ba5721d8..721955f3ab 100644
--- a/html/includes/graphs/port/mac_acc_total.inc.php
+++ b/html/includes/graphs/port/mac_acc_total.inc.php
@@ -65,7 +65,7 @@ $rrd_options .= " COMMENT:' In\: Current
foreach ($accs as $acc) {
$this_rrd = rrd_name($acc['hostname'], array('cip', $acc['ifIndex'], $acc['mac']));
- if (is_file($this_rrd)) {
+ if (rrdtool_check_rrd_exists($this_rrd)) {
$mac = formatmac($acc['mac']);
$name = $mac;
$addy = dbFetchRow('SELECT * FROM ipv4_mac where mac_address = ? AND port_id = ?', array($acc['mac'], $acc['port_id']));
diff --git a/html/includes/graphs/port/nupkts.inc.php b/html/includes/graphs/port/nupkts.inc.php
index a4c4296b10..dbbfebed8a 100644
--- a/html/includes/graphs/port/nupkts.inc.php
+++ b/html/includes/graphs/port/nupkts.inc.php
@@ -38,7 +38,7 @@ if (1) {
include 'includes/graphs/generic_multi_seperated.inc.php';
}
-else if (is_file($rrd_file)) {
+else if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_filename = $rrd_file;
$ds_in = 'INNUCASTPKTS';
diff --git a/html/includes/graphs/port/pagp_bits.inc.php b/html/includes/graphs/port/pagp_bits.inc.php
index 7cce013217..979a6d96a8 100644
--- a/html/includes/graphs/port/pagp_bits.inc.php
+++ b/html/includes/graphs/port/pagp_bits.inc.php
@@ -4,7 +4,7 @@
$i = 0;
foreach (dbFetchRows('SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?', array($port['device_id'], $port['ifIndex'])) as $int) {
$rrd_file = get_port_rrdfile_path ($hostname, int['port_id']);
- if (is_file($rrd_file)) {
+ if (rrdtool_check_rrd_exists($rrd_file)) {
$rrd_list[$i]['filename'] = $rrd_file;
$rrd_list[$i]['descr'] = $int['ifDescr'];
$i++;
diff --git a/html/pages/device/graphs/ipSytemStats.inc.php b/html/pages/device/graphs/ipSytemStats.inc.php
index dc77999a22..f457d2de8d 100644
--- a/html/pages/device/graphs/ipSytemStats.inc.php
+++ b/html/pages/device/graphs/ipSytemStats.inc.php
@@ -1,6 +1,6 @@