Is there a way to monitor NFS mount through PRTG and then execute certain commands if the mount has gone stale?

Thanks.


Article Comments

Hello,

Can you clarify for me what you mean by stale?

We can monitor them, I just need to understand the criteria so we can see if PRTG can detect when it's gone stale.

Benjamin Day
Paessler Support


Apr, 2019 - Permalink

Hi Benjamin,

For example when I run df -Th, I don't get any response as one of the mount has gone stale (maybe due to a network issue with remote server the mount is lost). A force remount in this case does not work. Only way to get the mount back is to reboot the server.

Thanks.


Apr, 2019 - Permalink

Hello,

So here is what I would recommend. Our SSH Disk Free sensor can detect NFS Shares as well as disk partitions.

Use this to monitor the NFS share, and then let me know how the sensor behaves when the share goes stale. If I'm right, the sensor should show nothing for disk free, which we can then use as a trigger to enact something.

This could be a script to that host to attempt to remount the share, or even reboot the machine.

Let me know.

Benjamin Day
Paessler Support


Apr, 2019 - Permalink

Hi Benjamin,

Thanks for your response. It's been bit of a delay. I am now monitoring the NFS share. Is there a guide on triggering scripts if there is no response or if sensor does not show anything?

Thanks.


Jul, 2019 - Permalink

Hello,

Yes, you can do this by creating a Notification Template that uses the option to Execute Program. Then you can have it run any script you would like by adding a Notification Trigger that uses the template.

Does this all make sense?

Benjamin Day
Paessler Support


Jul, 2019 - Permalink

Hi Benjamin,

So if I need to reboot the server via Notification template using Execute Program, then where will this script be triggered from? Will it be external to the server? Or does it need to reside in directory inside the server itself which needs rebooting?

Also, as I am already using the SSH Disk Free sensor, does this mean that I will still have to add SSH credentials inside the script? Or will only a reboot command suffice?

Thanks.


Jul, 2019 - Permalink

Hello,

The script itself will reside on the PRTG server. You can choose from *.exe, *.bat, *.cmd, *.com or *.ps1 files located in the Notifications/exe subfolder of your PRTG installation. If this list is empty, please copy all files you want to appear to the executables directory. The script will execute as if you were running it from a terminal on the PRTG server.

Thanks!
Benjamin Day
Paessler Support


Jul, 2019 - Permalink