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


Article Comments

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.


Dec, 2014 - Permalink

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


Jun, 2015 - Permalink

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. :)


Jun, 2015 - Permalink

Patrik, thanks a lot, works pretty fine.


Jun, 2015 - Permalink

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


Apr, 2016 - Permalink

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

/Pelle


Jun, 2017 - Permalink