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 - freeBSD

Votes:

0

I'm trying to run an SSH script sensor on my freebsd 9.2 p9 and are running into an obstacle. Script sensors are running fine on my Ubuntu 14 and Debian 7. Problem is that PRTG can't seem to find /var/prtg/scripts/.

The error message shows up in the windows where I choose which script to run.

"/: Event not found."

Please, anyone that could help me out? I know SSH sensors are able to run on my BSD since the disk-usage sensor works just fine.

Hope there's nothing wrong with my script.

/var/prtg/scripts/disk.sh

#!/bin/bash

LowTemp="12"
HighTemp="35"

Temp=$(smartctl -A /dev/$1 | grep 194 | cut -d: -f3 | awk '{print $10}')

for Temp in $Temp
        do
                if [ "$Temp" -lt "$LowTemp" ]
                then
                        echo "1:$Temp:Disk temperature is low."
                        break
                fi
                if [ "$Temp" -gt "$HighTemp" ]
                then
                        echo "1:$Temp:Disk temperature is high."
                        break
                else
                        echo "0:$Temp:OK"
                fi
        done

Regards Patrik

bash free-bsd linux prtg script ssh

Created on Dec 29, 2014 11:29:24 PM

Last change on Dec 30, 2014 7:51:50 AM by  Torsten Lindner [Paessler Support]



6 Replies

Votes:

4

Fixed!

It's a problem in PRTG. Made a sensor which stated the above. Then stopped both Core and Probe, changed the sensor in configuration file and corrected the script name. Started Probe and Core.

WORKS FLAWLESSLY! Did this for both regular script and advanced.

Created on Dec 30, 2014 7:33:24 PM



Votes:

0

Hi,

I have just stumbled across this forum post as I am facing a similar issue, but I don't understand the suggested workaround.

I have added a custom ssh script into /var/prtg/scriptsxml on the target server and it has all the necessary permissions.

I can log into the box via ssh and run the script without issue using the same username / password as I have provided to the device in PRTG.

However when I try to add the SSH Script Advanced sensor, instead of the scripts being available in the dropdown menu, I can only see this:

/d^/: Event Not Found

So I cannot even add the script during the sensor set up.

This is a Unix (Solaris) machine. Other SSH sensors, (e.g. SSH Disk Free) work absolutely fine.

The /var/prtg/scriptsxml folders have read permissions for the username, and the scripts have global execute permissions.

I am not sure what else to try (the previous answer suggests a restart but I am not sure why that should be necessary?). My only other thought is that Solaris is not supported - however other SSH sensors work OK.

Any ideas greatly appreciated!

Many thanks,

Tom

Created on Jun 1, 2015 11:54:20 AM



Votes:

0

That were exactly my error. I think PRTG can't handle BSD or Solaris.

I added the sensor with script as "/: Event not found." and stopped all PRTG services on the server. I then manually changed the sensor in the configuration file with a text-editor.

Configuration file is placed in your PRTG-data folder and is named "PRTG Configuration.dat".

Just open with random editor(I use notepad++) and search for "/d^/". Then change it to correct script. My advanced script is now called "array.sh" so for me the line below <scriptfile> says "array.sh|array.sh|"

After that, start your PRTG services again and enjoy your script.

If you need more than one, copy the old working sensor saves a lot of hassle.

Regards Patrik

Edit from Paessler Support: Please note that changing the PRTG configuration.dat can corrupt the configuration and lead to issues with your complete installation. With that said, we do not support manual changes of the configuration file.

Edit from Patrik: Please note that the BSD/Solaris users and community would appreciate if the issue stated above, PRTG not able to scan script folders and add custom sensors on BSD nor Solaris, was fixed. :)

Created on Jun 1, 2015 8:41:17 PM

Last change on Jun 8, 2015 5:56:48 AM by  Felix Saure [Paessler Support]



Votes:

0

Patrik, thanks a lot, works pretty fine.

Created on Jun 29, 2015 2:51:54 PM



Votes:

1

Hi,

Not sure if anyone is still watching this thread but I had a similar issue this week trying to point a new PRTG installation at a new linux server.

The scripts we were trying to add were working fine in other PRTG instances on other servers, however when trying to add new SSH Scripts, we were faced with an "Event Not Found" message where the dropdown list should be for choosing which script to execute.

To confuse us even more, SSH Script sensors imported from Templates worked OK.

We eventually narrowed the problem down to the default Shell. It appears it has to be "bash" for the PRTG internal process to be able "read" the /var/prtg folder, since this has a bash-specific syntax.

Once we had changed the default shell to "bash" using the "chsh" command, we could add new script sensors without any issues.

Hope this helps anyone looking for this solution!

Tom

Created on Apr 11, 2016 1:09:44 PM



Votes:

0

Hi, and thanks. Switching to bash using the "chsh" did it. PRTG now finds all scripts.

/Pelle

Created on Jun 14, 2017 12:27:58 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.