Jon Meek | 1 Dec 2006 14:02

Re: Any mon-sters attending LISA '06?

I registered a bit late, but I will be there.

Jon

On Sun, 29 Oct 2006, Ed Ravin wrote:

> Hey gang, it's that time of year again.  Anyone attending LISA '06
> in DC this December?
> 
> 	-- Ed
> 
> _______________________________________________
> mon mailing list
> mon <at> linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/mon
> 
Steven Schubiger | 1 Dec 2006 14:12
Picon

Handwritten sms.alert doesn't get executed

Hi!

I've been quite trying for a while to get a handwritten SMS executed by mon.
Everything is fine if I open a terminal and run the script with same 
parameters as defined in mon.cf -- the SMS gets send. When run
by mon, nothing happens.

Looked through the mailing list archive and found some familiar threads
which had some interesting remarks:

I checked if
* permissions are right (same as for all other alerts)
* the interpreter line was valid (same as for all other alerts)
* no absolute path specified (same as for most other alerts)
* perl -c <sms.alert>emits no warnings (same as for all other alerts)

Furthermore, I checked whether the script runs, but obviously it
doesn't. I've examined the syslog and the output generated 
from mon when called with the debugging flag, but they leave
me in a rather clueless state.

Thanks in advance,
Steven
Amias Channer | 1 Dec 2006 15:09

Re: Handwritten sms.alert doesn't get executed

On Fri, 1 Dec 2006 14:12:55 +0100
Steven Schubiger <steven.schubiger <at> xwave.ch> wrote:

> Hi!
> 
> I've been quite trying for a while to get a handwritten SMS executed by mon.
> Everything is fine if I open a terminal and run the script with same 
> parameters as defined in mon.cf -- the SMS gets send. When run
> by mon, nothing happens.
> 
> Looked through the mailing list archive and found some familiar threads
> which had some interesting remarks:
> 
> I checked if
> * permissions are right (same as for all other alerts)
> * the interpreter line was valid (same as for all other alerts)
> * no absolute path specified (same as for most other alerts)
> * perl -c <sms.alert>emits no warnings (same as for all other alerts)
> 
> Furthermore, I checked whether the script runs, but obviously it
> doesn't. I've examined the syslog and the output generated 
> from mon when called with the debugging flag, but they leave
> me in a rather clueless state.

I feel your pain  , have you checked for empty lines near your 
service definitions ?

e.g.  

hostname foobar 10.0.0.2
(Continue reading)

Steven Schubiger | 1 Dec 2006 16:15
Picon

Re: Handwritten sms.alert doesn't get executed

Am Freitag 01 Dezember 2006 15:09 schrieb Amias Channer:

> I feel your pain  , have you checked for empty lines near your
> service definitions ?
>
> e.g.
>
> hostname foobar 10.0.0.2
>
> watch foobar
> 	service wibble_ok
> 	service wibble_also_ok
>
> 	service wibble_will_be_ignored
>
> hostname foobaz 10.0.0.3
>
> watch foobar
>
> 	service wibble_will_also be_ignored
> 	service none_of_the_others_will_run_despite_being_ok

Yes, I had a look; there were indeed such blank lines, but removing
them didn't improve the matter in any way.

> This one bites my ass regularly especially with m4 generated configs.
>
> I'm looking at solving this problem in general and i think it can be done
> by piping the config file through sed which could run a regex to filter
> newlines around services.  That said i am wary of adding more
(Continue reading)

David Nolan | 1 Dec 2006 16:29
Picon
Favicon

Re: Handwritten sms.alert doesn't get executed

I sent this earlier, but I must have sent it from the wrong address
and its sitting in a moderation queue...

-David

---------- Forwarded message ----------
From: David Nolan <vitroth <at> cmu.edu>
Date: Dec 1, 2006 8:27 AM
Subject: Re: Handwritten sms.alert doesn't get executed
To: mon <at> linux.kernel.org

On 12/1/06, Steven Schubiger <steven.schubiger <at> xwave.ch> wrote:
> Hi!
>
> I've been quite trying for a while to get a handwritten SMS executed by mon.
> Everything is fine if I open a terminal and run the script with same
> parameters as defined in mon.cf -- the SMS gets send. When run
> by mon, nothing happens.
>
> Looked through the mailing list archive and found some familiar threads
> which had some interesting remarks:
>
> I checked if
> * permissions are right (same as for all other alerts)
> * the interpreter line was valid (same as for all other alerts)
> * no absolute path specified (same as for most other alerts)
> * perl -c <sms.alert>emits no warnings (same as for all other alerts)
>
> Furthermore, I checked whether the script runs, but obviously it
> doesn't. I've examined the syslog and the output generated
(Continue reading)

Steven Schubiger | 1 Dec 2006 17:19
Picon

Re: Handwritten sms.alert doesn't get executed

Am Freitag 01 Dezember 2006 16:29 schrieb David Nolan:

> You said "no absolute path specified", did you mean no non-absolute
> paths specified?  i.e. if your script runs a program named foobar from
> /usr/local/bin it should be calling it as /usr/local/bin/foobar, not
> assuming /usr/local/bin is in $PATH.  (Alternatively you can set $PATH
> in your script...)

I was referring to the inclusion of alert scripts within the mon config file;
should have called it "relative" though.

> Try adding some debugging code in your script.  i.e. if its perl add
> something like:
> open(LOG, ">/tmp/alertlog");
> ...
> print LOG "got to step XXX\n";
> ...
> print LOG "got to step YYY\n";

Tried it and was unsuccessful.

> When testing your alert are you also passing the other options that
> Mon sets when calling an alert?  i.e. '-g group -s service -h "list of
> hosts here"', etc...  (See the Mon man page for full documentation.)

No, I haven't, assuming it wasn't necessary. I'll give it a try.

> What user do you run mon as?  Have you tested su'ing to that user and
> running the script?

(Continue reading)

David Nolan | 1 Dec 2006 17:36
Picon
Favicon

Re: Handwritten sms.alert doesn't get executed

On 12/1/06, Steven Schubiger <steven.schubiger <at> xwave.ch> wrote:

> > When testing your alert are you also passing the other options that
> > Mon sets when calling an alert?  i.e. '-g group -s service -h "list of
> > hosts here"', etc...  (See the Mon man page for full documentation.)
>
> No, I haven't, assuming it wasn't necessary. I'll give it a try.
>

Looking at your script it should be an issue, you're not checking for
errors from getopt (for extra unparsed args..)

> > What user do you run mon as?  Have you tested su'ing to that user and
> > running the script?
>
> -rwxr-xr-x  1 root root 111458 2003-05-28 10:25 mon
>

Who owns the file on disk is not necessarily the same as the user the
process is running as.  Run 'ps waux | grep mon' or similar...  Since
you're trying to open /dev/ttyS1 you need to make sure that device is
writable by the user mon is executing as.

> > Can you post a copy of your script for us to look at?  (without any
> > SMS numbers, of course...)
>
> Sure, here you go:
>

I don't see any issues with the script offhand...  Did you try adding
(Continue reading)

Steven Schubiger | 1 Dec 2006 18:17
Picon

Re: Handwritten sms.alert doesn't get executed

Am Freitag 01 Dezember 2006 17:36 schrieb David Nolan:

> Looking at your script it should be an issue, you're not checking for
> errors from getopt (for extra unparsed args..)

I'll add them; nonetheless, I checked for extra unparsed args and there 
were none.

> Who owns the file on disk is not necessarily the same as the user the
> process is running as.  Run 'ps waux | grep mon' or similar...  Since
> you're trying to open /dev/ttyS1 you need to make sure that device is
> writable by the user mon is executing as.

root is the user who runs the process.

> I don't see any issues with the script offhand...  Did you try adding
> debugging code near the 'no connection with serial port' case?

Yes, unsuccessful.

> If you're still having issues, post your mon.cf snippet next...

How much of a snippet?

> -David

Regards,
Steven
Jeff Montagna | 1 Dec 2006 21:06
Picon

Re: netsnmp-freespace.monitor - No log handling enabled

On a i386 CentOS system this is fine, but only x86_64 system has the  
problem.  My guess is the netSNMP library was compiled with i386  
only.  For the short term I created a wrapper monitor for the  
freespace.monitor that discards stderr.

On Nov 29, 2006, at 8:53 PM, Ed Ravin wrote:

> Did you upgrade or downgrade the net-snmp libraries?  Googling for
> "No log handling enabled - turning on stderr logging" suggests that
> there is a Perl / NetSNMP library mismatch.
>
> Another possibility is that someone installed another copy of net-snmp
> / ucd-snmp in a directory in the library path, or the library path
> was changed and points to the wrong place.
>
> On Wed, Nov 29, 2006 at 09:35:27AM -0700, Jeff Montagna wrote:
>> Anyone have an idea of why logging would suddenly be disabled?
>> netsnmp-freespace.monitor was working fine yesterday then broke  
>> today.
>>
>> montaj1 <at> phxics1:mon.d$ ./netsnmp-freespace.monitor sts1
>> No log handling enabled - turning on stderr logging
>> truncating integer value to 32 bits
>> truncating integer value to 32 bits
>> truncating integer value to 32 bits
>> montaj1 <at> phxics1:mon.d$ ./netsnmp-freespace.monitor ltxnic7
>> No log handling enabled - turning on stderr logging
>> truncating integer value to 32 bits
>> ltxnic7
>>
(Continue reading)

David Nolan | 2 Dec 2006 03:19
Picon
Favicon

Fwd: Handwritten sms.alert doesn't get executed

Argh.... I did it again (sending from the wrong address and getting my
mail stuck in the moderator queue....)   I wonder why I hadn't seen a
response yet.  oops.

-David

---------- Forwarded message ----------
From: David Nolan <vitroth <at> cmu.edu>
Date: Dec 1, 2006 12:53 PM
Subject: Re: Handwritten sms.alert doesn't get executed
To: mon <at> linux.kernel.org

>
> How much of a snippet?
>

Uhh.. more than none, less than 1000 lines? :)

How about the hostgroup line and the entire watch definition.

Or you could drop the whole thing into pastebin, http://pastebin.com/,
and send the URL.

-David

Gmane