Sort By in Xymon Alert Emails
Hey,
So I have xymon setup to email us when the cpu usage of a machine gets too high for an extended period of time. It sends the top 50 processes in an email. Right now, it is sending them in ascending order by process id. This is not super helpful because then I have to parse through to find which is taking the most cpu %. Do you guys have any suggestions on how I can get the email to be sorted by the cpu% instead of the proc id?
Thanks!
David B
On Mon, Jun 18, 2012 at 7:32 PM, Balderston, David <dbalders at ucsd.edu> wrote:
which is taking the most cpu %. Do you guys have any suggestions on how I can get the email to be sorted by the cpu% instead of the proc id?
You can change how the data is sent to the xymon server by going into /home/xymon/client/bin and editing the xymonclient sh script for your os ( xymonclient-linux.sh for linux, for example) Look for the piece that lists processes, in linux it is :
echo "[ps]" ps -Aww -o pid,ppid,user,start,state,pri,pcpu,time,pmem,rsz,vsz,cmd
In linux you can add a sort option to ps; Your OS May Vary, but you can experiment with this command. Just be sure you return results in the format xymon expects (a header line followed by the right number of fields in the same order) or you'll have to go deeper.
(or you could write a custom test that runs top...)
participants (2)
-
betsy.schwartz@gmail.com
-
dbalders@ucsd.edu