Xymon Mailing List Archive search

Red alert delay.

5 messages in this thread

list Eli · Wed, 08 Apr 2015 17:57:36 -0600 ·

-------- Original Message --------
Subject: Red alert delay.
From: Eli <user-eeb3a3c6c848@xymon.invalid>
To: user-cbc56598d54b@xymon.invalid
CC: 

Hi all,
I do want to delay CPU load red alert. As you know the default yellow or red based on the threshold number but I want that include time delay. If the CPU load 9 and stay like that for 15 min the color to change red instead of turn red immidiatly reach 8.

Current setup

Load. 6.0 9.0

For idle

DS CPU vmstat.rrd:CPU_IDL <10 color=red "TEXT=CPU usage critical"

Thanks
list Phil Crooker · Thu, 9 Apr 2015 00:50:22 +0000 ·
quoted from Eli
Hi all,
I do want to delay CPU load red alert. As you know the default yellow or red based on the >threshold number but I want that include time delay. If the CPU load 9 and stay like that for 15 >min the color to change red instead of turn red immidiatly reach 8.

Current setup

Load. 6.0 9.0

For idle

DS CPU vmstat.rrd:CPU_IDL <10 color=red "TEXT=CPU usage critical"

Thanks
Have a look at the help text in alerts.cfg. You can use the DURATION flag:

# A sample rule:
#
# HOST=www.foo.com SERVICE=http
#      MAIL user-dd28c5cb1c5a@xymon.invalid REPEAT=20 RECOVERED
#      MAIL user-d0a7de99275f@xymon.invalid DURATION>60 COLOR=red
#      SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS

cheers.
list Eli · Wed, 08 Apr 2015 22:01:18 -0600 ·
Thanks Phil, I am looking delay on color change not on alarm. I have script monitoring the color change and act on it. 

Sent from my Verizon Wireless 4G LTE DROID
quoted from Phil Crooker

Phil Crooker <user-e8e31cd73303@xymon.invalid> wrote:
Hi all,
I do want to delay CPU load red alert. As you know the default yellow or red based on the >threshold number but I want that include time delay. If the CPU load 9 and stay like that for 15 >min the color to change red instead of turn red immidiatly reach 8.

Current setup

Load. 6.0 9.0

For idle

DS CPU vmstat.rrd:CPU_IDL <10 color=red "TEXT=CPU usage critical"

Thanks
Have a look at the help text in alerts.cfg. You can use the DURATION flag:

# A sample rule:
#
# HOST=www.foo.com SERVICE=http
#      MAIL user-dd28c5cb1c5a@xymon.invalid REPEAT=20 RECOVERED
#      MAIL user-d0a7de99275f@xymon.invalid DURATION>60 COLOR=red
#      SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS

cheers.
-- 

This message from ORIX Australia might contain confidential and/or
privileged information. If you are not the intended recipient, any use,
disclosure or copying of this message (or of any attachments to it) is
not authorised.

If you have received this message in error, please notify the sender
immediately and delete the message and any attachments from your
system. Please inform the sender if you do not wish to receive future
communications by email.

ORIX handles personal information according to a Privacy Policy that is
consistent with the National Privacy Principles. Please let us know if
you would like a copy. It is also available at http://www.orix.com.au .

list Phil Crooker · Thu, 9 Apr 2015 06:55:14 +0000 ·
Ah, understand now. Have a look at the host.cfg man page:


delayred=STATUSCOLUMN:DELAY[,STATUSCOLUMN:DELAY...]
Usually, status changes happen immediately. This tag is used to defer an update to red for the STATUSCOLUMN status for DELAY minutes. E.g. with delayred=disk:10,cpu:30, a red disk-status will not appear on the Xymon webpages until it has been red for at least 10 minutes. Note: Since most tests only execute once every 5 minutes, it will usually not make sense to set N to anything but a multiple of 5. The exception is network tests, since xymonnet-again.sh<https://www.xymon.com/help/manpages/man1/xymonnet-again.sh.1.html>;(1) will re-run failed network tests once a minute for up to 30 minutes.

However, this probably isn't what you want either as I assume you are querying the status directly via xymon. Your script can use the xymon xymondlog message (see the man page on xymon), the first line returned has the status times in Unix seconds:


# xymon 127.0.0.1 "xymondlog hostname.com.cpu"
hostname.com|cpu|green||1428554585|1428561954|1428563754|0|0|10.9.8.7||||Y|


You can pick out the lastchange column and calculate if it has been 15 mins.


cheers, Phil<mailto:user-8c58e1738592@xymon.invalid>
quoted from Eli

From: Eli <user-eeb3a3c6c848@xymon.invalid>
Sent: Thursday, 9 April 2015 1:31 PM
To: Phil Crooker
Cc: xymon at xymon.com
Subject: Re: [Xymon] Red alert delay.

Thanks Phil, I am looking delay on color change not on alarm. I have script monitoring the color change and act on it.

Sent from my Verizon Wireless 4G LTE DROID


Phil Crooker <user-e8e31cd73303@xymon.invalid> wrote:

Hi all,
I do want to delay CPU load red alert. As you know the default yellow or red based on the >threshold number but I want that include time delay. If the CPU load 9 and stay like that for 15 >min the color to change red instead of turn red immidiatly reach 8.

Current setup

Load. 6.0 9.0

For idle

DS CPU vmstat.rrd:CPU_IDL <10 color=red "TEXT=CPU usage critical"

Thanks
Have a look at the help text in alerts.cfg. You can use the DURATION flag:

# A sample rule:
#
# HOST=www.foo.com SERVICE=http
#      MAIL user-dd28c5cb1c5a@xymon.invalid REPEAT=20 RECOVERED
#      MAIL user-d0a7de99275f@xymon.invalid DURATION>60 COLOR=red
#      SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS

cheers.
--

This message from ORIX Australia might contain confidential and/or
privileged information. If you are not the intended recipient, any use,
disclosure or copying of this message (or of any attachments to it) is
not authorised.

If you have received this message in error, please notify the sender
immediately and delete the message and any attachments from your
system. Please inform the sender if you do not wish to receive future
communications by email.

ORIX handles personal information according to a Privacy Policy that is
consistent with the National Privacy Principles. Please let us know if
you would like a copy. It is also available at http://www.orix.com.au .
list Eli · Thu, 09 Apr 2015 11:50:27 -0600 ·
Thanks much Phil, that solved my issue.

Phil Crooker <user-e8e31cd73303@xymon.invalid> wrote:
<!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(166, 166, 166) solid;font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif;font-size:10pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(205, 230, 247);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 0px 6px 0px 6px;vertical-align:middle!important;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(205, 230, 247) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}.wf {speak:none; font-weight:normal; font-variant:normal; text-transform:none; -webkit-font-smoothing:antialiased; vertical-align:middle; display:inline-block;}.wf-family-owa {font-family:'o365Icons'}@font-face { font-family:'o365IconsIE8'; src:url('prem/15.0.995.34/resources/styles/office365icons.ie8.eot?#iefix') format('embedded-opentype'), url('prem/15.0.995.34/resources/styles/office365icons.ie8.woff') format('woff'), url('prem/15.0.995.34/resources/styles/office365icons.ie8.ttf') format('truetype'); font-weight:normal; font-style:normal;}@font-face { font-family:'o365IconsMouse'; src:url('prem/15.0.995.34/resources/styles/office365icons.mouse.eot?#iefix') format('embedded-opentype'), url('prem/15.0.995.34/resources/styles/office365icons.mouse.woff') format('woff'), url('prem/15.0.995.34/resources/styles/office365icons.mouse.ttf') format('truetype'); font-weight:normal; font-style:normal;}.wf-family-owa {font-family:'o365IconsMouse'}.ie8 .wf-family-owa {font-family:'o365IconsIE8'}.ie8 .wf-owa-play-large:before {content:'\e254';}.notIE8 .wf-owa-play-large:before {content:'\e054';}.ie8 .wf-owa-play-large {color:#FFFFFF/*$WFWhiteColor*/;}.notIE8 .wf-owa-play-large {border-color:#FFFFFF/*$WFWhiteColor*/; width:1.4em; height:1.4em; border-width:.1em; border-style:solid; border-radius:.8em; text-align:center; box-sizing:border-box; -moz-box-sizing:border-box; padding:0.1em; color:#FFFFFF/*$WFWhiteColor*/;}.ie8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-owa-triangle-down-small:before {content:'\e052';}.ie8 .wf-owa-triangle-down-small:before { content:'\e052';}.ie8 .wf-owa-triangle-down-small {color:#666666/*$WFGreyColor*/;}.wf-size-x20 {font-size: 20px!important;}--> 

Ah, understand now. Have a look at the host.cfg man page:


delayred=STATUSCOLUMN:DELAY[,STATUSCOLUMN:DELAY...]Usually, status changes happen immediately. This tag is used to defer an update to red for the STATUSCOLUMN status for DELAY minutes. E.g. with delayred=disk:10,cpu:30, a red disk-status will not appear on the Xymon webpages until it has been red for at least 10 minutes. Note: Since most tests only execute once every 5 minutes, it will usually not make sense to set N to anything but a multiple of 5. The exception is network tests, since xymonnet-again.sh(1) will re-run failed network tests once a minute for up to 30 minutes. 
quoted from Phil Crooker

However, this probably isn't what you want either as I assume you are querying the status directly via xymon. Your script can use the xymon xymondlog message (see the man page on xymon), the first line returned has the status times in Unix seconds:


# xymon 127.0.0.1 "xymondlog hostname.com.cpu"
hostname.com|cpu|green||1428554585|1428561954|1428563754|0|0|10.9.8.7||||Y|

You can pick out the lastchange column and calculate if it has been 15 mins.


cheers, Phil
quoted from Eli

From: Eli <user-eeb3a3c6c848@xymon.invalid>
Sent: Thursday, 9 April 2015 1:31 PM
To: Phil Crooker
Cc: xymon at xymon.com
Subject: Re: [Xymon] Red alert delay. 

 

Thanks Phil, I am looking delay on color change not on alarm. I have script monitoring the color change and act on it. 


Sent from my Verizon Wireless 4G LTE DROID


Phil Crooker <user-e8e31cd73303@xymon.invalid> wrote:

Hi all,
I do want to delay CPU load red alert. As you know the default yellow or red based on the >threshold number but I want that include time delay. If the CPU load 9 and stay like that for 15 >min the color to change red instead of turn red immidiatly reach 8.

Current setup

Load. 6.0 9.0

For idle

DS CPU vmstat.rrd:CPU_IDL <10 color=red "TEXT=CPU usage critical"

Thanks
Have a look at the help text in alerts.cfg. You can use the DURATION flag:

# A sample rule:
#
# HOST=www.foo.com SERVICE=http
#      MAIL user-dd28c5cb1c5a@xymon.invalid REPEAT=20 RECOVERED
#      MAIL user-d0a7de99275f@xymon.invalid DURATION>60 COLOR=red
#      SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS

cheers.
-- 

This message from ORIX Australia might contain confidential and/or
privileged information. If you are not the intended recipient, any use,
disclosure or copying of this message (or of any attachments to it) is
not authorised.

If you have received this message in error, please notify the sender
immediately and delete the message and any attachments from your
system. Please inform the sender if you do not wish to receive future
communications by email.

ORIX handles personal information according to a Privacy Policy that is
consistent with the National Privacy Principles. Please let us know if
you would like a copy. It is also available at http://www.orix.com.au .