Xymon Mailing List Archive search

how to ext script with bbwin ?

7 messages in this thread

list Bakkies Gatvol · Wed, 23 Jul 2014 08:14:38 -0400 ·
I don't usually do windows. 
I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html

I found below post via google ... but there is still large gaps in my understanding. 
 What format do you write a report in the bbwin tmp directory? Can I specify a column name ?


Hi Ryan,

I didn't understand why you use bbwincmd. You could use the externals
 agent to run your program every 5 minutes and your agent would just has
 to write a report in the bbwin tmp directory. Then, BBWin would take care to read the file and send the status to the hobbit server.

That would be much easier for you.

Don't you think ?

Etienne.


Can somebody give me more info or point me to any docs online? 
Thanks

Bakkies
list Jeremy Laidman · Fri, 25 Jul 2014 10:23:22 +1000 ·
From reading the source code of some of the externals, I think it works as
follows.

The filename is the column name.  So if you want a column/page called
"foobar" you would create a file called foobar.txt.

The first line needs to be in a specific format:

<color> <date> <time> [( <delay> )]

The optional delay in parens tells Xymon how long the report is to be
considered valid, before it goes purple (default is 30 minutes).

The line terminator is CRLF.

Subsequent lines contain the message to appear on the status page for the
column.

J
quoted from Bakkies Gatvol


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:
I don't usually do windows.

I have installed bbwin from here
http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html

I found below post via google ... but there is still large gaps in my
understanding.

What format do you *write a report in the bbwin tmp directory*? Can I
specify a column name ?

*Hi Ryan,*
*I didn't understand why you use bbwincmd. You could use the externals
agent to run your program every 5 minutes and your agent would just has to
write a report in the bbwin tmp directory. Then, BBWin would take care to
read the file and send the status to the hobbit server.*
*That would be much easier for you.*
*Don't you think ?*
*Etienne.*

Can somebody give me more info or point me to any docs online?

Thanks

Bakkies

list Bakkies Gatvol · Fri, 25 Jul 2014 09:44:21 -0400 ·
What format is the date? Do I have to put quotes around something?

I can get the column name and the color, but that is all I think that is working.

At the moment -  it drops the word red - it's first on the line as suggested, but the rest just shows up in the display.  This makes me think it is not interpreting any of it, purely dumping it on the screen.

on display
25-07-2014 14:01:31 ( 60 ) 

in file called evt (column name = evt ) 
red 25-07-2014 14:01:31 ( 60 ) 

I will happily read code if I could get my hands on it. I am too unix to know how to open/read a msi file. But c++ source I could probably read.

Thanks
quoted from Jeremy Laidman

From: user-71895fb2e44c@xymon.invalid
Date: Fri, 25 Jul 2014 10:23:22 +1000
Subject: Re: [Xymon] how to ext script with bbwin ?
To: user-66e2e196cd54@xymon.invalid
CC: xymon at xymon.com

From reading the source code of some of the externals, I think it works as follows.
The filename is the column name.  So if you want a column/page called "foobar" you would create a file called foobar.txt.


The first line needs to be in a specific format:
<color> <date> <time> [( <delay> )]
The optional delay in parens tells Xymon how long the report is to be considered valid, before it goes purple (default is 30 minutes).


The line terminator is CRLF.
Subsequent lines contain the message to appear on the status page for the column.
J


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:


I don't usually do windows. 

I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html


I found below post via google ... but there is still large gaps in my understanding. 

 What format do you write a report in the bbwin tmp directory? Can I specify a column name ?


Hi Ryan,

I didn't understand why you use bbwincmd. You could use the externals
 agent to run your program every 5 minutes and your agent would just has
 to write a report in the bbwin tmp directory. Then, BBWin would take 
care to read the file and send the status to the hobbit server.

That would be much easier for you.

Don't you think ?

Etienne.


Can somebody give me more info or point me to any docs online? 

Thanks

Bakkies
list Jürgen Mertin · Fri, 25 Jul 2014 20:51:57 +0000 ·
Hello

The date format is 26/07/2014 6:40:29 AM, which is easily achieved in VBScript using the command "Now()” (as in “strColor Now()”).

The entire process is quite simple when you think of Xymon as only displaying the text output of your command or script - your command or script needs to do the interpreting and then output the final result to a flat file.

For example, I call a VBS script that performs a minor audit of PCs, named xAudit.vbs.
This is included in the externals section of the cfg file, using: <load value="cscript //B //nologo xAudit.vbs" timer="120s"  />

The script writes the output to a text file in the tmp directory called xAudit (no extension required).
The first line of this file is simply the word “green”, which is enough for Xymon to display the contents of that file in the column named xAudit.
Of course, the colour conditions can be determined by your program or script before the results are written to your text file, perhaps using “if then” statements or other functions.

Thanks
Jürgen


In this script, an output is
quoted from Bakkies Gatvol

On 25 Jul 2014, at 23:44, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>> wrote:

What format is the date? Do I have to put quotes around something?

I can get the column name and the color, but that is all I think that is working.

At the moment -  it drops the word red - it's first on the line as suggested, but the rest just shows up in the display.  This makes me think it is not interpreting any of it, purely dumping it on the screen.

on display
25-07-2014 14:01:31 ( 60 )

in file called evt (column name = evt )
red 25-07-2014 14:01:31 ( 60 )

I will happily read code if I could get my hands on it. I am too unix to know how to open/read a msi file. But c++ source I could probably read.

Thanks

From: user-71895fb2e44c@xymon.invalid<mailto:user-71895fb2e44c@xymon.invalid>
Date: Fri, 25 Jul 2014 10:23:22 +1000
Subject: Re: [Xymon] how to ext script with bbwin ?
To: user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>
CC: xymon at xymon.com<mailto:xymon at xymon.com>

From reading the source code of some of the externals, I think it works as follows.

The filename is the column name.  So if you want a column/page called "foobar" you would create a file called foobar.txt.

The first line needs to be in a specific format:

<color> <date> <time> [( <delay> )]

The optional delay in parens tells Xymon how long the report is to be considered valid, before it goes purple (default is 30 minutes).

The line terminator is CRLF.

Subsequent lines contain the message to appear on the status page for the column.

J


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>> wrote:
I don't usually do windows.

I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html

I found below post via google ... but there is still large gaps in my understanding.

What format do you write a report in the bbwin tmp directory? Can I specify a column name ?

Hi Ryan,
I didn't understand why you use bbwincmd. You could use the externals agent to run your program every 5 minutes and your agent would just has to write a report in the bbwin tmp directory. Then, BBWin would take care to read the file and send the status to the hobbit server.
That would be much easier for you.
Don't you think ?
Etienne.

Can somebody give me more info or point me to any docs online?

Thanks

Bakkies
list Bakkies Gatvol · Mon, 28 Jul 2014 09:06:30 -0400 ·
From my experimentation it seems 

the filename is the column
the first word in the file is the color 
and the rest of the file is "message" and is just shown on the display. 

It does not seem to me that the date is read/interpreted in any way .. so it does not matter what format it is. It is just dumped to the display. 


I was hoping to be able to set the time-to-live, but I can (and will) live without it.


Thanks 
quoted from Jürgen Mertin

From: user-fcb9e44dc36e@xymon.invalid
To: user-66e2e196cd54@xymon.invalid
CC: user-71895fb2e44c@xymon.invalid; xymon at xymon.com
Subject: Re: [Xymon] how to ext script with bbwin ?
Date: Fri, 25 Jul 2014 20:51:57 +0000


Hello


The date format is 26/07/2014 6:40:29 AM, which is easily achieved in VBScript using the command "Now()” (as in “strColor Now()”). 


The entire process is quite simple when you think of Xymon as only displaying the text output of your command or script - your command or script needs to do the interpreting and then output the final result to a flat file.  


For example, I call a VBS script that performs a minor audit of PCs, named xAudit.vbs.
This is included in the externals section of the cfg file, using: <load value="cscript //B //nologo xAudit.vbs" timer="120s"  />


The script writes the output to a text file in the tmp directory called xAudit (no extension required).
The first line of this file is simply the word “green”, which is enough for Xymon to display the contents of that file in the column named xAudit. 
Of course, the colour conditions can be determined by your program or script before the results are written to your text file, perhaps using “if then” statements or other functions. 


Thanks
Jürgen


In this script, an output is 


On 25 Jul 2014, at 23:44, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:


What format is the date? Do I have to put quotes around something?


I can get the column name and the color, but that is all I think that is working.


At the moment -  it drops the word red - it's first on the line as suggested, but the rest just shows up in the display.  This makes me think it is not interpreting any of it, purely dumping it on the screen.


on display

25-07-2014 14:01:31 ( 60 ) 


in file called evt (column name = evt ) 

red 25-07-2014 14:01:31 ( 60 ) 


I will happily read code if I could get my hands on it. I am too unix to know how to open/read a msi file. But c++ source I could probably read.


Thanks


From: user-71895fb2e44c@xymon.invalid

Date: Fri, 25 Jul 2014 10:23:22 +1000

Subject: Re: [Xymon] how to ext script with bbwin ?

To: user-66e2e196cd54@xymon.invalid

CC: xymon at xymon.com


From reading the source code of some of the externals, I think it works as follows.


The filename is the column name.  So if you want a column/page called "foobar" you would create a file called foobar.txt.


The first line needs to be in a specific format:


<color> <date> <time> [( <delay> )]


The optional delay in parens tells Xymon how long the report is to be considered valid, before it goes purple (default is 30 minutes).


The line terminator is CRLF.


Subsequent lines contain the message to appear on the status page for the column.


J


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:


I don't usually do windows. 


I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html


I found below post via google ... but there is still large gaps in my understanding. 


What format do you write a report in the bbwin tmp directory? Can I specify a column name ?


Hi Ryan,

I didn't understand why you use bbwincmd. You could use the externals agent to run your program every 5 minutes and your agent would just has to write a report in the bbwin tmp directory. Then, BBWin would take care to read the file and send the status to
 the hobbit server.

That would be much easier for you.

Don't you think ?

Etienne.


Can somebody give me more info or point me to any docs online? 


Thanks


Bakkies
list Darin D [itsys] Dugan · Mon, 28 Jul 2014 13:14:00 +0000 ·
Here's an example from a PowerShell external I run from BBwin. The status is green with a lifetime of thirteen hours. The rest of the info is displayed on the page. (Note this test runs every six hours, hence 13 hours for a purple. Twice the interval plus a small margin is generally what you want for a lifetime, depending on requirements.)

green+13h 2014-07-25 16:51:39 scriptname.ps1 vX.Y
quoted from Bakkies Gatvol

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Bakkies Gatvol
Sent: Monday, July 28, 2014 8:07 AM
To: Xymon Mailing List
Subject: Re: [Xymon] how to ext script with bbwin ?

From my experimentation it seems

the filename is the column
the first word in the file is the color
and the rest of the file is "message" and is just shown on the display.

It does not seem to me that the date is read/interpreted in any way .. so it does not matter what format it is. It is just dumped to the display.


I was hoping to be able to set the time-to-live, but I can (and will) live without it.


Thanks
From: user-fcb9e44dc36e@xymon.invalid<mailto:user-fcb9e44dc36e@xymon.invalid>
To: user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>
CC: user-71895fb2e44c@xymon.invalid<mailto:user-71895fb2e44c@xymon.invalid>; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] how to ext script with bbwin ?
Date: Fri, 25 Jul 2014 20:51:57 +0000

Hello

The date format is 26/07/2014 6:40:29 AM, which is easily achieved in VBScript using the command "Now()" (as in "strColor Now()").

The entire process is quite simple when you think of Xymon as only displaying the text output of your command or script - your command or script needs to do the interpreting and then output the final result to a flat file.

For example, I call a VBS script that performs a minor audit of PCs, named xAudit.vbs.
This is included in the externals section of the cfg file, using: <load value="cscript //B //nologo xAudit.vbs" timer="120s"  />

The script writes the output to a text file in the tmp directory called xAudit (no extension required).
The first line of this file is simply the word "green", which is enough for Xymon to display the contents of that file in the column named xAudit.
Of course, the colour conditions can be determined by your program or script before the results are written to your text file, perhaps using "if then" statements or other functions.

Thanks
Jürgen


In this script, an output is
On 25 Jul 2014, at 23:44, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>> wrote:

What format is the date? Do I have to put quotes around something?

I can get the column name and the color, but that is all I think that is working.

At the moment -  it drops the word red - it's first on the line as suggested, but the rest just shows up in the display.  This makes me think it is not interpreting any of it, purely dumping it on the screen.

on display
25-07-2014 14:01:31 ( 60 )

in file called evt (column name = evt )
red 25-07-2014 14:01:31 ( 60 )

I will happily read code if I could get my hands on it. I am too unix to know how to open/read a msi file. But c++ source I could probably read.

Thanks
From: user-71895fb2e44c@xymon.invalid<mailto:user-71895fb2e44c@xymon.invalid>
Date: Fri, 25 Jul 2014 10:23:22 +1000
Subject: Re: [Xymon] how to ext script with bbwin ?
To: user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>
CC: xymon at xymon.com<mailto:xymon at xymon.com>
From reading the source code of some of the externals, I think it works as follows.

The filename is the column name.  So if you want a column/page called "foobar" you would create a file called foobar.txt.

The first line needs to be in a specific format:

<color> <date> <time> [( <delay> )]

The optional delay in parens tells Xymon how long the report is to be considered valid, before it goes purple (default is 30 minutes).

The line terminator is CRLF.

Subsequent lines contain the message to appear on the status page for the column.

J


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid<mailto:user-66e2e196cd54@xymon.invalid>> wrote:
I don't usually do windows.

I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html

I found below post via google ... but there is still large gaps in my understanding.

What format do you write a report in the bbwin tmp directory? Can I specify a column name ?
Hi Ryan,
I didn't understand why you use bbwincmd. You could use the externals agent to run your program every 5 minutes and your agent would just has to write a report in the bbwin tmp directory. Then, BBWin would take care to read the file and send the status to the hobbit server.
That would be much easier for you.
Don't you think ?
Etienne.

Can somebody give me more info or point me to any docs online?

Thanks

Bakkies
list Bakkies Gatvol · Mon, 28 Jul 2014 14:19:30 -0400 ·
I took your sample line and hand made a file in tmp accordingly. And wonderfully 2hours later and no purple yet. Excellent. 

Thanks much.
quoted from Darin D [itsys] Dugan

From: user-b33a1547d27a@xymon.invalid
To: user-66e2e196cd54@xymon.invalid; xymon at xymon.com
Subject: RE: [Xymon] how to ext script with bbwin ?
Date: Mon, 28 Jul 2014 13:14:00 +0000


Here’s an example from a PowerShell external I run from BBwin. The status is green with a lifetime of thirteen hours. The rest of the info is displayed on the
 page. (Note this test runs every six hours, hence 13 hours for a purple. Twice the interval plus a small margin is generally what you want for a lifetime, depending on requirements.)
 
green+13h 2014-07-25 16:51:39 scriptname.ps1 vX.Y
 

From: Xymon [mailto:xymon-bounces at xymon.com]
On Behalf Of Bakkies Gatvol

Sent: Monday, July 28, 2014 8:07 AM

To: Xymon Mailing List

Subject: Re: [Xymon] how to ext script with bbwin ?


From my experimentation it seems


the filename is the column

the first word in the file is the color 

and the rest of the file is "message" and is just shown on the display. 


It does not seem to me that the date is read/interpreted in any way .. so it does not matter what format it is. It is just dumped to the display.


I was hoping to be able to set the time-to-live, but I can (and will) live without it.


Thanks 


From: 
user-fcb9e44dc36e@xymon.invalid

To: user-66e2e196cd54@xymon.invalid

CC: user-71895fb2e44c@xymon.invalid; 

Subject: Re: [Xymon] how to ext script with bbwin ?

Date: Fri, 25 Jul 2014 20:51:57 +0000


Hello 

 
The date format is 26/07/2014 6:40:29 AM, which is easily achieved in VBScript using the command "Now()” (as in “strColor Now()”). 

 
The entire process is quite simple when you think of Xymon as only displaying the text output of your command or script - your command or script needs to do the interpreting and then output
 the final result to a flat file.  


For example, I call a VBS script that performs a minor audit of PCs, named xAudit.vbs.


This is included in the externals section of the cfg file, using: <load value="cscript //B //nologo xAudit.vbs" timer="120s"  />


The script writes the output to a text file in the tmp directory called xAudit (no extension required).


The first line of this file is simply the word “green”, which is enough for Xymon to display the contents of that file in the column named xAudit. 


Of course, the colour conditions can be determined by your program or script before the results are written to your text file, perhaps using “if then” statements or other functions. 


Thanks


Jürgen


In this script, an output is 


On 25 Jul 2014, at 23:44, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:

 
What format is the date? Do I have to put quotes around something?


I can get the column name and the color, but that is all I think that is working.


At the moment -  it drops the word red - it's first on the line as suggested, but the rest just shows up in the display.  This makes me think it is not interpreting any of it, purely dumping it on the screen.


on display

25-07-2014 14:01:31 ( 60 ) 


in file called evt (column name = evt ) 

red 25-07-2014 14:01:31 ( 60 ) 


I will happily read code if I could get my hands on it. I am too unix to know how to open/read a msi file. But c++ source I could probably read.


Thanks


From:
user-71895fb2e44c@xymon.invalid

Date: Fri, 25 Jul 2014 10:23:22 +1000

Subject: Re: [Xymon] how to ext script with bbwin ?

To: user-66e2e196cd54@xymon.invalid

CC: xymon at xymon.com

From reading the source code of some of the externals, I think it works as follows.


The filename is the column name.  So if you want a column/page called "foobar" you would create a file called foobar.txt.


The first line needs to be in a specific format:


<color> <date> <time> [( <delay> )]


The optional delay in parens tells Xymon how long the report is to be considered valid, before it goes purple (default is 30 minutes).


The line terminator is CRLF.


Subsequent lines contain the message to appear on the status page for the column.


J


On 23 July 2014 22:14, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:


I don't usually do windows. 


I have installed bbwin from here http://jmac-software.blogspot.com/2012/03/xymon-windows-client-set-up-guide.html


I found below post via google ... but there is still large gaps in my understanding. 


What format do you write a report in the bbwin tmp directory? Can I specify a column name ?

Hi Ryan,

I didn't understand why you use bbwincmd. You could use the externals agent to run your program every 5 minutes and your agent would just has to write a report in the bbwin tmp directory. Then, BBWin would take care to read the file and send the status to
 the hobbit server.

That would be much easier for you.

Don't you think ?

Etienne.


Can somebody give me more info or point me to any docs online? 


Thanks


Bakkies