A custom probe I have written to monitor the power status at our sites has an
parameter option for either 1 or 2 power supplies is working as follows:
Code:
<snmp-device-display>
\B5\Device Statistics:\0P\
\B2\ ${eval: ($Power_Supplies_1_or_2 =1)?"Single $System_Voltage Volt Power
Supply":($Power_Supplies_1_or_2 =2)?"Dual $System_Voltage Volt Power
Supplies":"Unknown"}\0P\
PSU # 1: ${chartable: #.## : $InputA} Volts DC
PSU # 2: ${chartable: #.## : $InputB} Volts DC
Battery: ${chartable: #.## : $InputC} Volts DC
AC Power: ${chartable: # : $InputD} VAC
Temperature : ${chartable: # : $Sensor1} ° Celcius
</snmp-device-display>
The first eval displays either single or dual supply correctly.
In the snmp device display I want it to not display the results for the voltage
of the second power supply if the parameter is set to 1, but display normally
if the parameter is set to 2.
When I make this change for PSU#2:
Code:
<snmp-device-display>
\B5\Device Statistics:\0P\
\B2\ ${eval: ($Power_Supplies_1_or_2 =1)?"Single $System_Voltage Volt Power
Supply":($Power_Supplies_1_or_2 =2)?"Dual $System_Voltage Volt Power
Supplies":"Unknown"}\0P\
PSU # 1: ${chartable: #.## : $InputA} Volts DC
${eval: ($Power_Supplies_1_or_2 =1)?"":"PSU # 2: ${chartable: #.## :
$InputB} Volts DC"}
Battery: ${chartable: #.## : $InputC} Volts DC
AC Power: ${chartable: # : $InputD} VAC
Temperature : ${chartable: # : $Sensor1} ° Celcius
</snmp-device-display>
Now when the probe parameter is set to 1 for a single power supply, that line
is now blank as desired (ideally it would skip the line entirely), but when the
parameter is set to 2 for dual power supplies, the line shows:
Code:
PSU # 2: <NotFound:chartable: #.## : $InputB> Volts DC
It appears as though it is treating the "${chartable: #.## : $InputB}" as a
variable.
I am not terribly familiar with perl and this may just need to be formatted
differently, but I have tried many different ways with parenthesis to get it to
interpret this the way I want, but I am stumped so I am posting here in the
hopes that it can be done and I just need some help to get me going the right
direction.
Thanks in advance for any assistance.
-------------------- m2f --------------------
Read this topic online here:
http://forums.intermapper.com/viewtopic.php?p=4059#4059
____________________________________________________________________
List archives:
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]