What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

SSH Script Advanced Sensor, string return value not displayed

Votes:

0

Hi

I have here a SSH Script Advanced Sensor for monitoring a asterisk with a script.

I have on some return values from the digium cards a string instead a number.

Can i use string and display them in PRTG where i can set an alarm on it like:

- OK = Green
- Yel = Warning
- Red = Alarm

?

Here a part of the script, that gives a integer back for the moment:

# Check DIGIUM Card Port 1
DIGI1=$(asterisk -rx "dahdi show status" | sed -n '2p' | cut -d " " -f 22)
echo -n "<result>
       <channel>DIGIUM Port 1 Status</channel>
         <value>"
if [ "OK" = "$DIGI1" ]; 
then
	echo "1"
else
	echo "-1"
fi
echo "</value>
		 <unit>custom</unit>
		 <customunit></customunit>
</result>"

asterisk linux ssh-script-advanced-sensor

Created on Nov 5, 2014 11:53:34 AM

Last change on Nov 10, 2014 2:13:27 PM by  Torsten Lindner [Paessler Support]



1 Reply

Votes:

2

Hi,

as your script returns integers anyway, you may want to use those in combination with value lookups (https://www.paessler.com/manuals/prtg/define_lookups.htm). That way, you can have PRTG translating the integer values of your script into custom string messages AND the according sensor state.

Created on Nov 10, 2014 12:54:29 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.