how to view xymon variables?
list Deepak Deore
how can I view the below variables? BBCOLORLEVELThe current color of the statusBBALPHAMSGThe full text of the status log triggering the alert ACKCODEThe "cookie" that can be used to acknowledge the alertRCPTThe recipient, from the SCRIPT entryBBHOSTNAME The name of the host that the alert is aboutMACHIPThe IP-address of the host that has a problemBBSVCNAMEThe name of the service that the alert is about BBSVCNUMThe numeric code for the service. From SVCCODES definition.BBHOSTSVCHOSTNAME.SERVICE that the alert is about. BBHOSTSVCCOMMASAs BBHOSTSVC, but dots in the hostname replaced with commasBBNUMERICA 22-digit number made by BBSVCNUM, MACHIP and ACKCODE. RECOVEREDIs "1" if the service has recovered.DOWNSECSNumber of seconds the service has been down. DOWNSECSMSGWhen recovered, holds the text "Event duration : N" where N is the DOWNSECS value. I tried this script with the below commands which didn't work, it didn't return the variable values. #!/bin/sh echo $BBALPHAMSG $xymoncmd script_name $xymonlaunch script_name Thanks
list Jeremy Laidman
On 31 May 2013 14:45, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
how can I view the below variables? BBCOLORLEVEL
If you run bbcmd on its own, it will set all of the variables for you and run a sub-shell. Try this: $ /usr/lib/xymon/client/bin/xymoncmd $ set | grep BB $ set | grep XYMON $ exit The variables you listed all appear to be for an alert script. These are all set by the xymond_alert program, for scripts that it runs, and these variables won't be defined outside of that context. If you want to test an alert script, you might need to setup a dummy alert in alerts.cfg. J
list Deepak Deore
So, do you mean to say that these variables which I listed are only available during alerts ? Can I echo these variables in any of my custom script? eg. put "echo $BBALPHAMSG > some_file" in my custom script?
▸
On Fri, May 31, 2013 at 1:15 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 31 May 2013 14:45, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:how can I view the below variables? BBCOLORLEVELIf you run bbcmd on its own, it will set all of the variables for you and run a sub-shell. Try this: $ /usr/lib/xymon/client/bin/xymoncmd $ set | grep BB $ set | grep XYMON $ exit The variables you listed all appear to be for an alert script. These are all set by the xymond_alert program, for scripts that it runs, and these variables won't be defined outside of that context. If you want to test an alert script, you might need to setup a dummy alert in alerts.cfg. J
list Jeremy Laidman
▸
On 31 May 2013 19:50, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
So, do you mean to say that these variables which I listed are only available during alerts ? Can I echo these variables in any of my custom script?
Yes.
eg. put "echo $BBALPHAMSG > some_file" in my custom script?
Only in an alert script. J
list Deepak Deore
I did echo this variable in one of my custom script on xymon client. i.e. client/ext/myscript.sh But I didn't get the value. Is this the file you are talking about or any other alert script?
▸
On Mon, Jun 3, 2013 at 5:13 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 31 May 2013 19:50, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:So, do you mean to say that these variables which I listed are only available during alerts ? Can I echo these variables in any of my custom script?Yes.eg. put "echo $BBALPHAMSG > some_file" in my custom script?Only in an alert script. J
list Jeremy Laidman
▸
On 3 June 2013 23:21, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
I did echo this variable in one of my custom script on xymon client. i.e. client/ext/myscript.sh But I didn't get the value. Is this the file you are talking about or any other alert script?
This should apply to any script named in an SCRIPT clause in alerts.cfg.
But it only applies when the script is called by xymond_alert as a result
of an alert condition.
J
list Deepak Deore
hmmm, i got the variables now. Thanks a lot
▸
On Tue, Jun 4, 2013 at 10:21 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 3 June 2013 23:21, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:I did echo this variable in one of my custom script on xymon client. i.e. client/ext/myscript.sh But I didn't get the value. Is this the file you are talking about or any other alert script?This should apply to any script named in an SCRIPT clause in alerts.cfg. But it only applies when the script is called by xymond_alert as a result of an alert condition. J