Xymon Mailing List Archive search

Alerts

11 messages in this thread

list Martin Lyberg · Fri, 11 Nov 2005 12:27:58 +0100 ·
Hi,

I've been using BB for several years, and now when i had to build a new
machine i found Hobbit!! Hobbit is much better than BB, but i have a
question though.

I want to send and email-alert to myself if i get a red alert on any of my
monitored systems on any servicers. How can i do this? Is it possbile to use
some kind of wildcard? I tried HOST=* but it didn't work.

Thanks in advance

/ Martin
list Henrik Størner · Fri, 11 Nov 2005 14:13:29 +0100 ·
quoted from Martin Lyberg
On Fri, Nov 11, 2005 at 12:27:58PM +0100, Martin Lyberg wrote:
I want to send and email-alert to myself if i get a red alert on any of my
monitored systems on any servicers. How can i do this? Is it possbile to use
some kind of wildcard? I tried HOST=* but it didn't work.
This in the ~hobbit/server/etc/hobbit-alerts.cfg should do it:

    HOST=*
	MAIL user-74d3530ce3ee@xymon.invalid

If it doesn't work, then please check if you can send mail at all
from the Hobbit server. If you run

    echo "mail test" | mail user-74d3530ce3ee@xymon.invalid

and the mail does not arrive, you'll have to check your mail setup
first.


Regards,
Henrik
list Martin Lyberg · Fri, 11 Nov 2005 15:36:32 +0100 ·
quoted from Henrik Størner
On 11/11/05, Henrik Stoerner wrote:
This in the ~hobbit/server/etc/hobbit-alerts.cfg should do it:

HOST=*
MAIL user-74d3530ce3ee@xymon.invalid

If it doesn't work, then please check if you can send mail at all
from the Hobbit server. If you run

echo "mail test" | mail user-74d3530ce3ee@xymon.invalid

and the mail does not arrive, you'll have to check your mail setup
first.

Odd, same syntax that didn't work at first. Seems to work now though.

Thank you!

/ Martin
list Martin Lyberg · Fri, 11 Nov 2005 15:49:42 +0100 ·
Henrik,

I have som further questions on this topic. I'm not quite sure of the syntax
here. I want to be notified ONLY if the color is red or purple. Can this be
made on a single line like this:

HOST=*
MAIL root REPEAT=1h COLOR=red,purple

Question 2:

I want to send notifications to other people on certain hosts. How can i add
multiple sites on the same line, this doesn't seem to work:

HOST=www.domain1.com|www.domain2.com|www.domain3.com
MAIL user-e2c0c4f8a224@xymon.invalid COLOR=red,purple,yellow REPEAT=1h RECOVERED
MAIL user-6109888833b7@xymon.invalid COLOR=red,purple,yellow REPEAT=1h RECOVERED

Thanks in advance

/ Martin
list Henrik Størner · Fri, 11 Nov 2005 17:38:17 +0100 ·
quoted from Martin Lyberg
On Fri, Nov 11, 2005 at 03:49:42PM +0100, Martin Lyberg wrote:
I have som further questions on this topic. I'm not quite sure of the syntax
here. I want to be notified ONLY if the color is red or purple. Can this be
made on a single line like this:

HOST=*
MAIL root REPEAT=1h COLOR=red,purple
Yes.
quoted from Martin Lyberg
I want to send notifications to other people on certain hosts. How can i add
multiple sites on the same line, this doesn't seem to work:

HOST=www.domain1.com|www.domain2.com|www.domain3.com
You can either list individual hosts, but then you must use commas
to separate hostnames. Like
   HOST=www.domain1.com,www.domain2.com,www.domain3.com
or you can use regular expressions - these begin with a '%' sign, 
followed by the regex. How you'll define that obviously depends on
the hostnames involved, for your example it might be
   HOST=%www.domain[123].com


Henrik
list Adam Scheblein · Fri, 11 Nov 2005 11:22:56 -0600 ·
Greetings,

When compiling the newest snapshot on HP-UX 11.0 with gcc, i get the following error:

CC="/usr/local/bin/gcc" CFLAGS="-g -O -D_REENTRANT -DHPUX -I. -I`pwd`/include -DCLIENTONLY=1" OSDEF="-DHPUX" RPATHOPT="" PCREINCDIR="" SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="-lnsl" BBTOPDIR="/home/hobbit" BBLOGDIR="" BBHOSTNAME="" BBHOSTIP="134.48.22.240" BBHOSTOS="" LOCALCLIENT="no" /usr/local/bin/gmake -C lib client
gmake[1]: Entering directory `/home/hobbit/uploaded/snapshot/lib'
/usr/local/bin/gcc -g -O -D_REENTRANT -DHPUX -I. -I/home/hobbit/uploaded/snapshot/include -DCLIENTONLY=1 -I. -I../include    -c -o osdefs.o osdefs.c
In file included from osdefs.c:16:
osdefs.h:25: error: conflicting types for `snprintf'
/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.3.2/include/stdio.h:493: error: previous declaration of `snprintf'
gmake[1]: *** [osdefs.o] Error 1
gmake[1]: Leaving directory `/home/hobbit/uploaded/snapshot/lib'
gmake: *** [lib-client] Error 2


Any ideas?

thanks,
Adam
list Adam Scheblein · Fri, 11 Nov 2005 11:28:17 -0600 ·
As a quick fix, (and a fix for an additional similar problem)  i changed the osdefs.h file to be the following (take note, i had to rename the snprintf and the socklen_t variables):

/*----------------------------------------------------------------------------*/
/* Hobbit monitor library.                                                    */
/* Compatibility definitions for various OS's                                 */
/*                                                                            */
/* Copyright (C) 2002-2005 Henrik Storner <user-e180c691dbbd@xymon.invalid>                 */
/*                                                                            */
/* This program is released under the GNU General Public License (GPL),       */
/* version 2. See the file "COPYING" for details.                             */
/*                                                                            */
/*----------------------------------------------------------------------------*/

#ifndef __LIBBBGEN_OSDEFS_H__
#define __LIBBBGEN_OSDEFS_H__

#include "config.h"

#include <sys/types.h>
#include <stdarg.h>

#ifndef HAVE_SOCKLEN_T
typedef int hobbit_socklen_t;
#endif

#ifndef HAVE_SNPRINTF
extern int hobbit_snprintf(char *str, size_t size, const char *format, ...);
#endif

#ifndef HAVE_VSNPRINTF
extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif

#endif
quoted from Adam Scheblein


Adam Scheblein wrote:
Greetings,

When compiling the newest snapshot on HP-UX 11.0 with gcc, i get the following error:

CC="/usr/local/bin/gcc" CFLAGS="-g -O -D_REENTRANT -DHPUX -I. -I`pwd`/include -DCLIENTONLY=1" OSDEF="-DHPUX" RPATHOPT="" PCREINCDIR="" SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="-lnsl" BBTOPDIR="/home/hobbit" BBLOGDIR="" BBHOSTNAME="" BBHOSTIP="134.48.22.240" BBHOSTOS="" LOCALCLIENT="no" /usr/local/bin/gmake -C lib client
gmake[1]: Entering directory `/home/hobbit/uploaded/snapshot/lib'
/usr/local/bin/gcc -g -O -D_REENTRANT -DHPUX -I. -I/home/hobbit/uploaded/snapshot/include -DCLIENTONLY=1 -I. -I../include    -c -o osdefs.o osdefs.c
In file included from osdefs.c:16:
osdefs.h:25: error: conflicting types for `snprintf'
/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.3.2/include/stdio.h:493: error: previous declaration of `snprintf'
gmake[1]: *** [osdefs.o] Error 1
gmake[1]: Leaving directory `/home/hobbit/uploaded/snapshot/lib'
gmake: *** [lib-client] Error 2


Any ideas?

thanks,
Adam

list Martin Lyberg · Tue, 15 Nov 2005 15:58:10 +0100 ·
quoted from Henrik Størner
On 11/11/05, Henrik Stoerner wrote:

You can either list individual hosts, but then you must use commas
to separate hostnames. Like

HOST=www.domain1.com <http://www.domain1.com>,www.domain2.com<http://www.domain2.com>;
,www.domain3.com <http://www.domain3.com>;
quoted from Henrik Størner
or you can use regular expressions - these begin with a '%' sign,
followed by the regex. How you'll define that obviously depends on
the hostnames involved, for your example it might be
HOST=%www.domain[123].com

Thank you, it works like a charm now. I had a blankspace before my hosts ie:

HOST= domain1.com <http://domain1.com>,etc,etc instead of:
HOST=domain1.com <http://domain1.com>,etcetc

That's why it didn't work before.

/ Martin
list Adam Scheblein · Tue, 15 Nov 2005 09:08:28 -0600 ·
Greetings,

I have modified the ps in all my clients so that it also sends out per-process cpu usage, and now am trying to use a regular perl expression in the search for processes with a certain usage percentage.  Here is what i have:
%(8\d{2}\.\d{2})|(9[0-4]\.\d{2}) and %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) as 2 of my searches

These don't work however, because they pull up everything that is 8.xx 8x.xx 9.xx 9x.xx 1.xx 1x.xx and 1xx.xx  I know these espressions work, because i tested them in a perl application...  all i am trying to make it pull out is 8x.xx 9x.xx and 1xx.xx

Any ideas for a fix (either a patch or another way to do this type of a search)??

thanks,
Adam
list Henrik Størner · Tue, 15 Nov 2005 16:42:34 +0100 ·
quoted from Adam Scheblein
On Tue, Nov 15, 2005 at 09:08:28AM -0600, Adam Scheblein wrote:
Greetings,

I have modified the ps in all my clients so that it also sends out 
per-process cpu usage, and now am trying to use a regular perl 
expression in the search for processes with a certain usage percentage.  
Here is what i have:
%(8\d{2}\.\d{2})|(9[0-4]\.\d{2}) and %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) as 
2 of my searches
I think you have an error in that first expression - the "8\d{2}" seems
wrong, if you want it to match number 80-89. It should be "8\d" without
the "{2}".
quoted from Adam Scheblein
These don't work however, because they pull up everything that is 8.xx 
8x.xx 9.xx 9x.xx 1.xx 1x.xx and 1xx.xx
I'm not sure what data you're feeding it, but I tried with this setup in
hobbit-clients.cfg:

HOST=localhost
        PROC %(8\d\.\d{2})|(9[0-4]\.\d{2}) 0 0
	PROC %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) 0 0

This will give a red if any of the commands in the "ps" listing has the
percentages 80-94 or 95-100. Now let's test it:

$ bbcmd hobbitd_client --test
Hostname (.=end, ?=dump, !=reload) [localhost]: localhost
Test (cpu, mem, disk, proc): proc
ps command string: 82.31 ls
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color red: Count=1, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

Good, the ps commandline string "82.31 ls" is matched as it should be.

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 8.29 ls
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

And the string "8.29 ls" is not matched. 

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 100.00 muncher
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color red: Count=1, min=0, max=0

"100.00 muncher" is also matched

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 1.00 low
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

But "1.00 low" is now matched.


So either your rules are different from what I've used, or your ps
output is unlike that which I used. I think you'll need to post some
more details for us to figure out what the problem is.


Regards,
Henrik
list Adam Scheblein · Tue, 15 Nov 2005 11:38:51 -0600 ·
quoted from Henrik Størner
Henrik Stoerner wrote:
On Tue, Nov 15, 2005 at 09:08:28AM -0600, Adam Scheblein wrote:
 
Greetings,

I have modified the ps in all my clients so that it also sends out 
per-process cpu usage, and now am trying to use a regular perl 
expression in the search for processes with a certain usage percentage.  
Here is what i have:
%(8\d{2}\.\d{2})|(9[0-4]\.\d{2}) and %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) as 
2 of my searches
   
I think you have an error in that first expression - the "8\d{2}" seems
wrong, if you want it to match number 80-89. It should be "8\d" without
the "{2}".

 
OK -- i checked my rules, and realized that i typed them into the e-mail 
wrong -- here is a direct cut/paste
PROC %(8\d\.\d{2})|(9[0-4]\.\d{2}) 0 0 yellow
PROC %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) 0 0 red

After i pasted this i realized that i was also pulling IP addresses, so 
i changed the rules to this:
PROC %\s+((8\d\.\d{2})|(9[0-4]\.\d{2}))\s+ 0 0 yellow
PROC %\s+((9[5-9]\.\d{2})|(1\d{2}\.\d{2}))\s+ 0 0 red


Which now work, but seems to be acting strange because when it finds a 
bad process it reports this(keep in mind that these are sorted by cpu 
usage and nothing has been edited/cut out):

red %\s+((9[5-9]\.\d{2})|(1\d{2}\.\d{2}))\s+ (found 7, req. at most 0)

adam     18178 18176 99.63 11:19:16 pts/3       02:00 -bash
root        19     0  0.55  Nov  8  ?           05:29 vxfsd

so i am not sure where the "found 7" is coming from, when clearly there 
is only 1...

Thanks,
Adam
quoted from Henrik Størner
These don't work however, because they pull up everything that is 8.xx 
8x.xx 9.xx 9x.xx 1.xx 1x.xx and 1xx.xx
   
I'm not sure what data you're feeding it, but I tried with this setup in
hobbit-clients.cfg:

HOST=localhost
       PROC %(8\d\.\d{2})|(9[0-4]\.\d{2}) 0 0
PROC %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) 0 0

This will give a red if any of the commands in the "ps" listing has the
percentages 80-94 or 95-100. Now let's test it:

$ bbcmd hobbitd_client --test
Hostname (.=end, ?=dump, !=reload) [localhost]: localhost
Test (cpu, mem, disk, proc): proc
ps command string: 82.31 ls
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color red: Count=1, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

Good, the ps commandline string "82.31 ls" is matched as it should be.

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 8.29 ls
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

And the string "8.29 ls" is not matched. 

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 100.00 muncher
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color red: Count=1, min=0, max=0

"100.00 muncher" is also matched

Hostname (.=end, ?=dump, !=reload) [localhost]:
Test (cpu, mem, disk, proc): proc
ps command string: 1.00 low
ps command string:
Process %(8\d\.\d{2})|(9[0-4]\.\d{2}) color green: Count=0, min=0, max=0
Process %(9[5-9]\.\d{2})|(1\d{2}\.\d{2}) color green: Count=0, min=0, max=0

But "1.00 low" is now matched.


So either your rules are different from what I've used, or your ps
output is unlike that which I used. I think you'll need to post some
more details for us to figure out what the problem is.


Regards,
Henrik