SOURCES: cacti-ss_disk-array-indices.patch (NEW) - silence php warning acce...
glen
glen at pld-linux.org
Tue Oct 7 18:29:20 CEST 2008
Author: glen Date: Tue Oct 7 16:29:20 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- silence php warning accessing items from array that don't exist if queried host is unreachable
---- Files affected:
SOURCES:
cacti-ss_disk-array-indices.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/cacti-ss_disk-array-indices.patch
diff -u /dev/null SOURCES/cacti-ss_disk-array-indices.patch:1.1
--- /dev/null Tue Oct 7 18:29:21 2008
+++ SOURCES/cacti-ss_disk-array-indices.patch Tue Oct 7 18:29:15 2008
@@ -0,0 +1,17 @@
+--- ./scripts/ss_host_disk.php 2008-10-05 18:19:17.656634044 +0300
++++ ./scripts/ss_host_disk.php 2008-10-07 11:07:10.120905407 +0300
+@@ -65,7 +65,14 @@
+ $arg = $arg1;
+
+ $arr_index = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids["index"], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER));
++ if (empty($arr_index)) {
++ return;
++ }
+ $arr = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids[$arg], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER));
++ if (empty($arr)) {
++ // we likely already got error already earlier, like "Timeout: No Response from localhost:161"
++ return;
++ }
+
+ for ($i=0;($i<sizeof($arr_index));$i++) {
+ print $arr_index[$i] . "!" . $arr[$i] . "\n";
================================================================
More information about the pld-cvs-commit
mailing list