Hi,

I’m sure this has been asked before, but I can’t find an answer :)

I have a script that reads a temperature sensor and outputs the result to 
stdout.

I want to test the result and take an action if the the reading is above or 
below a threshold

I currently set the exits status as a workaround, but I’m looking for a more 
general solution I have:

check program testscript with path "/root/Scripts/tst.sh" with timeout 100 
seconds
    if status < 0 then alert
    if status > 22 then exec '/usr/local/bin/hot.sh'
    if status < 17 then exec '/usr/local/bin/cold.sh'


It would be more useful if I could do something like:

check program testscript with path "/root/Scripts/tst.sh" with timeout 100 
seconds
    if atoi(stdout) < 0 then alert
    if stdout) > 22 then exec '/usr/local/bin/hot.sh'
    if stdout < 17 then exec '/usr/local/bin/cold.sh'

Of course you may have a better way . . . . 


=============================
Andrew Holt

Email: [email protected]

De Omnibus Dubitandum
=============================



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to