Hi all,
I have a Windows Scheduled Task that runs a report on a Sybase DB, and outputs the results to 3 files on a mapped Samba share on a Unix server.
I want to be able to monitor the last modified date of each of the 3 files and graph this in PRTG. This will allow me to historically map the run time of each report.
I tried to use something like the below as a custom ssh script:
- !/bin/bash
stat=`stat -c %Z /opt/cbis/bo_cbis_home/work/banking/export/cash_rec_reports_net.log`
echo 0:$stat:working
But PRTG stated that the output was not well formed.
Is there anyway that I can do this?
Thanks in advance
Andrew
p.s. Im still pretty new to PRTG so if i've missed something simple, go easy on me!
Article Comments
Hi Greg, thanks for your advice.
I've managed to get over the initial issue with my result being "not well formed", by doing something similar to what you have suggested above.
Whilst the script is now working, it is returning an epoch number (1,381,881,603), is there a way that PRTG can translate that into a real time, or do I need to do that from within my script?
Also, is there a way I can tell PRTG to say "if the value has not changed, do not report it"? The monitored files will only be updated between 1am and 8am, and I just want to be able to graph the run times - for the time being.
Thanks
Andrew
Oct, 2013 - Permalink
Unfortunately you will need to convert the time yourself in the sensor, there is no way to do this with the EXE / XML sensor.
This is also sadly not something that can be done with the EXE/XML sensor. You might want to try and program the sensor to be differential that way when there is no change it registers a 0 but other than that there isn't an option for this in that sensor.
Oct, 2013 - Permalink
How you should be able to get this to work would be to create an SSH script with this text
the issue I think is '' that you used to define the variable since that returns the command there and not the number result. Also, you don't need to call out bash since this sensor already takes care of that. Also make sure that you are using the SSH Script Sensor and not the advanced since the advanced look for different formatting.
Oct, 2013 - Permalink