Original:
Code: Select all
function ss_f5tmm_mem($hostname, $snmp_community, $snmp_version, $snmp_port, $sn
mp_timeout, $snmpv3_auth_username, $snmpv3_auth_password) {
Code: Select all
function ss_f5tmm_mem($hostname, $snmp_community, $snmp_version, $snmp_port
, $snmp_timeout, $snmpv3_auth_username, $snmpv3_auth_password, $snmpv3_auth_prot
ocol, $snmpv3_priv_passphrase, $snmpv3_priv_protocol, $snmpv3_context = "", $ret
ries = 0) {
Code: Select all
<path_cacti>/scripts/ss_f5-bigip-tmm-memory.php ss_f5tmm_mem <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout> <snmp_auth_username> <snmp_auth_password> <snmp_auth_proto> <snmp_priv_password> <snmp_priv_proto> <snmp_context>
Looks fine at a glance, but what happens when we're dealing with a V3 only host that has no community string?
05/02/2008 06:06:05 PM - CMDPHP: Poller[0] Host[206] DS[2872] SERVER: /export/cacti.imanheim.com/htdocs/scripts/ss_f5-bigip-tmm-memory.php ss_f5tmm_mem 10.XX.XX.XX 3 161 500 (v3user) (authpass) (authproto) (privpass) (privproto) , output: sysStatMemoryTotal:NaN sysStatMemoryUsed:NaN
Note the lack of a placeholder for the "community" value immediately after the IP address. As a result all arguments get shifted and the script naturally fails. How do I account for this? I ran the script server by hand and tried passing in those arguments with quotes around them, but in the case of values like "v3user" the quotes are read literally.
Any advice at all would be greatly appreciated. I couldn't find anything documenting this particular problem.