I have the following Script in
/var/prtg/scripts/mysqld_openfiles.sh to monitor the open files from the mysqld process.
#!/bin/bash num_proc="$(lsof -p $(pidof mysqld) | wc -l)" ret=0 retstring="mysqld open_files normal" if (("$num_proc" > 300)); then ret=1 retstring="Warning! mysqld open_files critical! $num_proc" fi if (("$num_proc" > 4000)); then ret=2 retstring="Error! mysqld open_files too high! $num_proc" fi echo "$ret:$num_proc:$retstring"
which currently gives me the following output
1:742:Warning! mysqld open_files critical! 742
However in PRTG the status is shown as green with message "mysqld open_files normal" and always value of 5. I already refreshed the script several times and also waited for 15 minutes to trigger a normal recheck but the status did not change.
Am I missing something?
By this KB question the Status should switch to yellow and value should be the 742.
Thanks for your help.