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

Simple Linux SSH script for monitoring output value

Votes:

0

Hi,

I have a USB temperature sensor running on a Debian machine and I want to add it to PRTG using an SSH script sensor. I am sure this question has been asked a million times before and I have spent an hour reading through other threads but haven't been quite able to get my head around it.

I can run a command on the Debian machine that simply outputs a result in Celsius, from the command line it looks like this:

root@dubs:~# temper-poll -c
20.0
root@dubs:~#

All I want to do is to have PRTG graph the result, in which this case is 20.0 From various reading it seems I have to write a script that includes exit codes as well, which I am not really able to completely understand. Some other posts have suggested I need to script it with an XML output and use the SSH Advanced sensor, so I am a little confused.

Can anyone please give me any tips on how I can achieve this?

linux ssh-script usb

Created on Apr 19, 2019 4:54:52 PM

Last change on Apr 22, 2019 8:54:50 AM by  Benjamin Day [Paessler Support] (1,441) 2 1



1 Reply

Votes:

0

BonezAU,

Sure, you just need to modify the output using awk. The command needs to follow the following format
returncode:value:message
So when you execute the script it needs to output an example like the following;
0:20.0:OK

Then you just link the SSH Script sensor to the script.

Benjamin Day
Paessler Support

Created on Apr 22, 2019 8:58:20 AM by  Benjamin Day [Paessler Support] (1,441) 2 1




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.