Your script has a lot of errors in it from a quick look-see, did you have a 
cut+paste massacre perhaps ?


   - if weewxd is not running at all, it'll blow up in your 'if' statement
   - you have braces and parens all messed up in your usage calculation line
   - do you really mean '3' and '4' for your thresholds ?  Guessing not.
   - the if/then flow doesn't make any sense to me

Try to work this one out yourself a little more.


   - rename your 'threshold' and 'threshold2' variables to be able to 
   understand what you wrote 6 months from now (or at least comment the code a 
   bit)
   - Hard-set usage's value to a good value, walk through your logic and 
   see what it will do
   - then hard-set it to a value in between your two thresholds, walk 
   through your logic and see what it'll do
   - then hard-set it to a value over the 'need to restart' threshold, walk 
   through your logic and see what it'll do
   - then hard-set it to a non-numeric value and see if the code breaks (it 
   will)
   - then hard-set it to a null value and see if the code breaks (it will)
   - then try it live in a 'log only, take no action mode' for a bit
   - then try it live for real, taking action as needed
   
If it's me, my flow would be something like:

   - if it's bad, syslog a message (hint - use 'logger') and try to take 
   action to fix it
   - if it's semi-bad, syslog a message saying it's in the not-great middle 
   range
   - if it's ok, 'consider' logging "all is good"
   - in all cases, log the actual data so you have that in the message (ie, 
   "weewx mem usage 23.3 % (ok)" or the like)
   

But you should really do the coding and analysis here so you can 
effectively 'own' your solution long-term.




-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f7aba085-c3c5-41c0-87a6-319376e4f030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to