• BASH Script MkII

    From Spectre@21:3/101 to Tenser on Saturday, January 18, 2020 18:41:00
    echo "SABRETOOTH! Your Server Load Alert Needs Attention! \n $(cat /proc/loadavg) " | mail -s "System Load Alert" spectre@tlp.zapto.org


    Can you tell me why neither of these produce a new line at \n? Ahh my bad, I found an answer to this one, with a -e on the echo.

    However... my next concern is at what load average to send the warning at. Now that the email contains the actual load average, I can safely set it lower, but the thing is really just idling, its an 8 core processor so its load avg is effectively under 1 all the time. It seems to spike as high as 7 intermittantly.. and normally between 5-6. Haven't gotten to the bottom of why it spikes yet. Oddly enough the xscreen saver seems to be part of the problem. And of course if I have rogue installations in the BBS user it pops straight out to 20...

    Soooo do I leave it at approx 6 and watch the intermittant spikes come and go? Do I got for 8 or more after it exceeds an effective load average of one, or do I place it perhaps as high as 10-15 and just catch the really weird stuff that is still occasionally getting installed?

    I've presently set it for greater than 7, but thoughts would be appreciated.

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)
  • From Spectre@21:3/101 to Tenser on Saturday, January 18, 2020 18:41:00
    echo "SABRETOOTH! Your Server Load Alert Needs Attention! \n $(cat /proc/loadavg) " | mail -s "System Load Alert" spectre@tlp.zapto.org


    Can you tell me why neither of these produce a new line at \n? Ahh my bad, I


























































































































































































































































































































































    found an answer to this one, with a -e on the echo.

    However... my next concern is at what load average to send the warning at. Now that the email contains the actual load average, I can safely set it lower,


























































































































































































































































































































































    but the thing is really just idling, its an 8 core processor so its load avg is


























































































































































































































































































































































    effectively under 1 all the time. It seems to spike as high as 7 intermittantly.. and normally between 5-6. Haven't gotten to the bottom of why it spikes yet. Oddly enough the xscreen saver seems to be part of the problem. And of course if I have rogue installations in the BBS user it pops straight out to 20...

    Soooo do I leave it at approx 6 and watch the intermittant spikes come and go?


























































































































































































































































































































































    Do I got for 8 or more after it exceeds an effective load average of one, or do


























































































































































































































































































































































    I place it perhaps as high as 10-15 and just catch the really weird stuff that is still occasionally getting installed?

    I've presently set it for greater than 7, but thoughts would be appreciated.

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)
  • From Spectre@21:3/101 to Tenser on Saturday, January 18, 2020 18:41:00
    echo "SABRETOOTH! Your Server Load Alert Needs Attention! \n $(cat /proc/loadavg) " | mail -s "System Load Alert" spectre@tlp.zapto.org


    Can you tell me why neither of these produce a new line at \n? Ahh my bad, I
    found an answer to this one, with a -e on the echo.

    However... my next concern is at what load average to send the warning at. Now that the email contains the actual load average, I can safely set it lower,
    but the thing is really just idling, its an 8 core processor so its load avg is effectively under 1 all the time. It seems to spike as high as 7 intermittantly.. and normally between 5-6. Haven't gotten to the bottom of why it spikes yet. Oddly enough the xscreen saver seems to be part of the problem. And of course if I have rogue installations in the BBS user it pops straight out to 20...

    Soooo do I leave it at approx 6 and watch the intermittant spikes come and go?
    Do I got for 8 or more after it exceeds an effective load average of one, or do I place it perhaps as high as 10-15 and just catch the really weird stuff that is still occasionally getting installed?

    I've presently set it for greater than 7, but thoughts would be appreciated.

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)
  • From Spectre@21:3/101 to tenser on Monday, January 20, 2020 06:05:00
    So you might consider making your script email you the output of `top

    You're going to make me read the man page aren't you....I've
    only ever used top in an interactive fashion :)

    Heh. Actually, on Linux, `top` may not be what you want. It appears
    to ONLY support an interactive mode (complete with all the

    And the winner is... top -b -n1 for just 1 iteration.. :)

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: < Scrawled in blood at The Lower Planes > (21:3/101)
  • From Spectre@21:3/101 to MeaTLoTioN on Friday, January 24, 2020 13:02:00
    Nice, yeah my method isn't necessarily elegant or the most efficient
    but it did what I needed it to. I love learning how other people
    approach the same problems and see how they overcome them.

    The most important part is it works :) 98% functionality, 2% anything else

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: < Scrawled in blood at The Lower Planes > (21:3/101)