New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Simple Linux SSH script for monitoring output value

Votes:

0

Your Vote:

Up

Down

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:

[email protected]:~# temper-poll -c
20.0
[email protected]:~#

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 by  BonezAU (0) 1

Last change on Apr 22, 2019 8:54:50 AM by  Benjamin Day [Paessler Support]



1 Reply

Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.