[Nagios-users] monitor number of open files on linux

2012-06-08 Thread Parkman, Mikhail
Can somebody recommend plugin to monitor number of opened files.

Thanks.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] monitor number of open files on linux

2012-06-08 Thread Parkman, Mikhail
Thanks - I decided to go with check_open_files.pl
http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check-open-files/details

I didn't find help_me/read_me info for this plugin.
After I installed it on the target box into /usr/local/nagios/libexec and just 
executed it, I got:
--
[root@target_host libexec]# ./check_open_files.pl
Usage:  -w warn -c crit [-t timeout] [-v version] [-h help]
[root@target_host libexec]#
==
That told me that I should run it at least with -w some_value1 -c some_value2
Then I tried to run it with different -w -c values and I am not clear why I am 
getting different threshold values (bold, red) :
===
[root@ target_host libexec]# ./check_open_files.pl  -w 500 -c 1
OK: open files (4590) is below threshold 
(16194515/323890300)|open_files=4590;16194515;323890300
[root@ target_host libexec]# ./check_open_files.pl -w 1000 -c 1
OK: open files (4590) is below threshold 
(32389030/323890300)|open_files=4590;32389030;323890300
[root@ target_host libexec]# ./check_open_files.pl -w 10 -c 100
OK: open files (4590) is below threshold 
(323890/3238903)|open_files=4590;323890;3238903
===
Why do I get in response 2 threshold values and why are they different each 
time I enter another number of warning and critical limits?
===
By the way, total system files limits on the target box is:

 [root@ target_host libexec]# cat /proc/sys/fs/file-max
3238903
===
Thanks.
-Original Message-
From: Edwin Zoeller 
[mailto:edwin.zoel...@ama-assn.org]mailto:[mailto:edwin.zoel...@ama-assn.org]
Sent: Friday, June 08, 2012 8:47 AM
To: Nagios Users List
Subject: Re: [Nagios-users] monitor number of open files on linux

Check_open_files.pl

-Original Message-
From: Parkman, Mikhail 
[mailto:mikhail_park...@cable.comcast.com]mailto:[mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, June 08, 2012 10:20 AM
To: Nagios Users List
Subject: [Nagios-users] monitor number of open files on linux

Can somebody recommend plugin to monitor number of opened files.

Thanks.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.netmailto:Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.netmailto:Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] monitor number of open files on linux

2012-06-08 Thread Parkman, Mikhail
Thank you, Allan -  yes this so obvious after you spelled it out for met.
Somehow I was thinking in the absolute numbers of open files instead of % of 
total.

From: Allan Clark [mailto:all...@chickenandporn.com]
Sent: Friday, June 08, 2012 2:09 PM
To: Nagios Users List
Subject: Re: [Nagios-users] monitor number of open files on linux

On Fri, Jun 8, 2012 at 1:53 PM, Parkman, Mikhail 
mikhail_park...@cable.comcast.commailto:mikhail_park...@cable.comcast.com 
wrote:
Thanks - I decided to go with check_open_files.plhttp://check_open_files.pl
http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check-open-files/details

I didn't find help_me/read_me info for this plugin.
After I installed it on the target box into /usr/local/nagios/libexec and just 
executed it, I got:
--
[root@target_host libexec]# ./check_open_files.plhttp://check_open_files.pl
Usage:  -w warn -c crit [-t timeout] [-v version] [-h help]
[root@target_host libexec]#
==
That told me that I should run it at least with -w some_value1 -c some_value2
Then I tried to run it with different -w -c values and I am not clear why I am 
getting different threshold values (bold, red) :
===
[root@ target_host libexec]# ./check_open_files.plhttp://check_open_files.pl  
-w 500 -c 1
OK: open files (4590) is below threshold 
(16194515/323890300)|open_files=4590;16194515;323890300
[root@ target_host libexec]# ./check_open_files.plhttp://check_open_files.pl 
-w 1000 -c 1
OK: open files (4590) is below threshold 
(32389030/323890300)|open_files=4590;32389030;323890300
[root@ target_host libexec]# ./check_open_files.plhttp://check_open_files.pl 
-w 10 -c 100
OK: open files (4590) is below threshold 
(323890/3238903)|open_files=4590;323890;3238903
===
Why do I get in response 2 threshold values and why are they different each 
time I enter another number of warning and critical limits?

Clearly, in general terms compared to other plugins:

1) you're getting OK because 4590 is less than the thresholds you've set; had 
it exceeded 323890 (in the -w10 example) then you'd get WARN, and if it 
exceeded the other, an ERROR response.  The actual thresholds are returned back 
because they are based on a calculation, and when the values are below, but the 
suer thinks they shouldn't be, the Nagios/Icinga screen would show the ref 
values as well as a comment.

2) your question as to why the numbers change might be more complex than I'm 
reading, but it's clearly taking % of total system files as a threshold:

-w 500 -- 500% of (cat /proc/sys/fs/file-max) == 16194515
-c 1 -- 1% of (cat /proc/sys/fs/file-max) == 323890300

Have I misread your question(s)?

I would suggest you set your thresholds to alarm on percentages; I'm not sure 
50% and 80% are good numbers, but -w 50 -c 80 would achieve those.

Allan
--
all...@chickenandporn.commailto:all...@chickenandporn.com  金鱼 
http://linkedin.com/in/goldfish
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] server log plugin

2012-04-06 Thread Parkman, Mikhail
Thank you, Claudio,
It was simple to setup, and it works.
I have one question.
Here is my command in the /usr/local/nagios/etc/nrpe.cfg on the target host:

command[check_server_log]=/usr/local/nagios/libexec/check_logfiles 
--logfile=/opt/cvs-jboss7/standalone/log/server.log --criticalpattern=ERROR 
--noprotocol

Default output message is  ok - no errors or warnings

Since I am checking for errors only, this message is somehow misleading in my 
case.
Does somebody know how to change it to
ok - no errors 

Thanks.
Mikhail.


From: Claudio Kuenzler [mailto:c...@claudiokuenzler.com]
Sent: Thursday, April 05, 2012 12:18 PM
To: Nagios Users List
Subject: Re: [Nagios-users] server log plugin

This one is probably the best one:
http://labs.consol.de/lang/en/nagios/check_logfiles/
On Thu, Apr 5, 2012 at 6:56 PM, Parkman, Mikhail 
mikhail_park...@cable.comcast.commailto:mikhail_park...@cable.comcast.com 
wrote:
I need to perform the following tasks:

*  Demonstrated that Nagios alert is fired when certain messages are logged in 
the application log file on the target (remote) host
*  Nagios info message is fired when error condition is cleared.

I found out logwarn plugin but I didn't find detailed configuration 
instructions for this plugin.

http://exchange.nagios.org/directory/Plugins/Log-Files/check_logwarn/details

And another one - check_logfiles - this one is described better in my opinion 
but referring to something called OPSVIEW that I don't have any idea about.

http://www.osupport.net/2011/log-files-monitoring-with-nagios-opsview/


Did somebody have experience with well documented check log plugin, and could 
recommend one so that the functionality of the recommended plugin matches 
bulleted tasks in the beginning of this email that I have to accomplish?

Thanks.
Mikhail.


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.netmailto:Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

[Nagios-users] server log plugin

2012-04-05 Thread Parkman, Mikhail
I need to perform the following tasks:

*  Demonstrated that Nagios alert is fired when certain messages are logged in 
the application log file on the target (remote) host
*  Nagios info message is fired when error condition is cleared.

I found out logwarn plugin but I didn't find detailed configuration 
instructions for this plugin.

http://exchange.nagios.org/directory/Plugins/Log-Files/check_logwarn/details

And another one - check_logfiles - this one is described better in my opinion 
but referring to something called OPSVIEW that I don't have any idea about.

http://www.osupport.net/2011/log-files-monitoring-with-nagios-opsview/


Did somebody have experience with well documented check log plugin, and could 
recommend one so that the functionality of the recommended plugin matches 
bulleted tasks in the beginning of this email that I have to accomplish?

Thanks.
Mikhail.

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

[Nagios-users] nagios message broker experience

2012-04-02 Thread Parkman, Mikhail
Did somebody have experience with the setup of  Nagios message broker from

http://snippets.syabru.ch/nagios-msg-broker/

Thanks.
Mikhail.
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

[Nagios-users] how to associate /bin/bash with shell script in Nagios

2012-03-30 Thread Parkman, Mikhail
Hello,

I have the following command:

define command{
command_namedlg_notifications
command_line/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
}

And the following service

define service{
   use mypc
   service_description 
dlg_Alerts_notifications
   check_command  dlg_notifications
   max_check_attempts 1
   retain_status_information0
   retain_nonstatus_information0
   }

/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
runs fine manually.

Service defined above can't run it though.
While googling around, I found out that apparently Nagios does not know that 
script should be executed by /bin/bash

How would I let Nagios know about /bin/bash

Thanks.
Mikhail.
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] how to associate /bin/bash with shell script in Nagios

2012-03-30 Thread Parkman, Mikhail
Sorry for confusion - I was just trying different combinations.

But initially my command definition was following:

define command{
command_namedlg_notifications
command_line/usr/local/nagios/libexec/nagios-msg-broker.sh
}

I have #!/bin/bash in the top of my shell script, and shell script is set to 
be executable.

perfserver-10:/usr/local/nagios/libexec$ ls -l nagios-msg-broker.sh
-rwxrwxrwx 1 nagios nagcmd 149 Mar 30 10:04 nagios-msg-broker.sh

Thanks.
Mikhail.

From: James Pratt [mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 9:53 AM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

I'm slightly confused - Do you have #!/bin/bash in the top of your shell 
script, and is it set to be executable by (at least) the nagios user?  (Not 
sure why you are calling bash then the script name as an arg, that is odd to 
me, but maybe I'm missing something)?

Cheers,
Jamie

From: Parkman, Mikhail 
[mailto:mikhail_park...@cable.comcast.com]mailto:[mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, March 30, 2012 12:43 PM
To: 
nagios-users@lists.sourceforge.netmailto:nagios-users@lists.sourceforge.net
Subject: [Nagios-users] how to associate /bin/bash with shell script in Nagios

Hello,

I have the following command:

define command{
command_namedlg_notifications
command_line/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
}

And the following service

define service{
   use mypc
   service_description 
dlg_Alerts_notifications
   check_command  dlg_notifications
   max_check_attempts 1
   retain_status_information0
   retain_nonstatus_information0
   }

/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
runs fine manually.

Service defined above can't run it though.
While googling around, I found out that apparently Nagios does not know that 
script should be executed by /bin/bash

How would I let Nagios know about /bin/bash

Thanks.
Mikhail.
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] how to associate /bin/bash with shell script in Nagios

2012-03-30 Thread Parkman, Mikhail
Actually I verified that this script runs fine manually using default (Bourne) 
shell too.
So now I have #!/bin/sh in the beginning of my script and it still is not 
being picked up by service.
And I restart Nagios to initiate the service attempt.
Do you refer to Bourne shell (#!/bin/sh ) in  this part of your explanation:

 (If it's a shell script, nagios will execute it using the proper interpreter, 
so there is no way to tell nagios to use bash if that makes sense)?

If you do, and since I still  can't initiate the script should I su - nagios 
user anyway?

And responding to Edwin's question, it is on local host.

Thanks.
Mikhail.

From: James Pratt [mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 11:33 AM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Ok, so it's working fine when you run it from the command line, but not for 
nagios user, correct? (If it's a shell script, nagios will execute it using the 
proper interpreter, so there is no way to tell nagios to use bash if that 
makes sense)?

I usually su - nagios user, then try and run it from that user account - that's 
usually where the problem is, it runs fine  for root or whoever, but fails for 
the nagios user for whatever reason...

Cheers,
Jamie
From: Parkman, Mikhail [mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, March 30, 2012 1:28 PM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Sorry for confusion - I was just trying different combinations.

But initially my command definition was following:

define command{
command_namedlg_notifications
command_line/usr/local/nagios/libexec/nagios-msg-broker.sh
}

I have #!/bin/bash in the top of my shell script, and shell script is set to 
be executable.

perfserver-10:/usr/local/nagios/libexec$ ls -l nagios-msg-broker.sh
-rwxrwxrwx 1 nagios nagcmd 149 Mar 30 10:04 nagios-msg-broker.sh

Thanks.
Mikhail.

From: James Pratt [mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 9:53 AM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

I'm slightly confused - Do you have #!/bin/bash in the top of your shell 
script, and is it set to be executable by (at least) the nagios user?  (Not 
sure why you are calling bash then the script name as an arg, that is odd to 
me, but maybe I'm missing something)?

Cheers,
Jamie

From: Parkman, Mikhail 
[mailto:mikhail_park...@cable.comcast.com]mailto:[mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, March 30, 2012 12:43 PM
To: 
nagios-users@lists.sourceforge.netmailto:nagios-users@lists.sourceforge.net
Subject: [Nagios-users] how to associate /bin/bash with shell script in Nagios

Hello,

I have the following command:

define command{
command_namedlg_notifications
command_line/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
}

And the following service

define service{
   use mypc
   service_description 
dlg_Alerts_notifications
   check_command  dlg_notifications
   max_check_attempts 1
   retain_status_information0
   retain_nonstatus_information0
   }

/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh
runs fine manually.

Service defined above can't run it though.
While googling around, I found out that apparently Nagios does not know that 
script should be executed by /bin/bash

How would I let Nagios know about /bin/bash

Thanks.
Mikhail.
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] how to associate /bin/bash with shell script in Nagios

2012-03-30 Thread Parkman, Mikhail
The script represents in Nagios terms external application.
It runs on the local (monitoring) box.
Script due to its content makes connection to the mbeans on the remote server 
(target box),
receives notifications from mbeans, and then writes to the external fifo file 
(usr/local/nagios/var/rw/nagios.cmd)

message in the predefined format:

PROCESS_SERVICE_CHECK_RESULT;host_name;service_description;return_code;plugin_output

One message for one notification.

It looks to me that “remote stuff” is not applicable in that case.

When I run this script manually on the local monitoring host, it runs and 
writes data to the file.
When it is initiated by service defined on the same monitoring host in the .cfg 
file, nothing happens.

If I want this script to be initiated by “su – nagios”, how exactly I 
incorporate it within existing command and service definitions on the 
monitoring host?

Thanks.
Mikhail.

From: James Pratt [mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 12:19 PM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Yes I agree with Ed as well on the remote stuff -

And yes, the *nix OS determines what shell/program (eg perl/bash/sh/zsh etc) to 
execute the script with by the shebang line in the top of the file, and whether 
or not it's executable.

I would definitely try and execute it as the nagios user - that is all that is 
left in your case it seems (?)

From: Edwin Zoeller 
[mailto:edwin.zoel...@ama-assn.org]mailto:[mailto:edwin.zoel...@ama-assn.org]
Sent: Friday, March 30, 2012 3:11 PM
To: 'nagios-users@lists.sourceforge.net'
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

If this is run on a remote host using nrpe this what I would check:

- type which bash on the remote host and make sure the path matches what's in 
your script.

- verify your nrpe.cfg has an entry in it for your script I.e check_myscript

- verify on the master that check commands matches the remote entry

Ed

From: Parkman, Mikhail 
[mailto:mikhail_park...@cable.comcast.com]mailto:[mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, March 30, 2012 01:50 PM
To: Nagios Users List 
nagios-users@lists.sourceforge.netmailto:nagios-users@lists.sourceforge.net
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Actually I verified that this script runs fine manually using default (Bourne) 
shell too.
So now I have #!/bin/sh in the beginning of my script and it still is not 
being picked up by service.
And I restart Nagios to initiate the service attempt.
Do you refer to Bourne shell (#!/bin/sh ) in  this part of your explanation:

“ (If it's a shell script, nagios will execute it using the proper interpreter, 
so there is no way to tell nagios to use bash if that makes sense)?”

If you do, and since I still  can’t initiate the script should I su - nagios 
user anyway?

And responding to Edwin’s question, it is on local host.

Thanks.
Mikhail.

From: James Pratt 
[mailto:jpr...@norwich.edu]mailto:[mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 11:33 AM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Ok, so it's working fine when you run it from the command line, but not for 
nagios user, correct? (If it's a shell script, nagios will execute it using the 
proper interpreter, so there is no way to tell nagios to use bash if that 
makes sense)?

I usually su - nagios user, then try and run it from that user account - that's 
usually where the problem is, it runs fine  for root or whoever, but fails for 
the nagios user for whatever reason...

Cheers,
Jamie
From: Parkman, Mikhail 
[mailto:mikhail_park...@cable.comcast.com]mailto:[mailto:mikhail_park...@cable.comcast.com]
Sent: Friday, March 30, 2012 1:28 PM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

Sorry for confusion - I was just trying different combinations.

But initially my command definition was following:

define command{
command_namedlg_notifications
command_line/usr/local/nagios/libexec/nagios-msg-broker.sh
}

I have #!/bin/bash in the top of my shell script, and shell script is set to 
be executable.

perfserver-10:/usr/local/nagios/libexec$ ls -l nagios-msg-broker.sh
-rwxrwxrwx 1 nagios nagcmd 149 Mar 30 10:04 nagios-msg-broker.sh

Thanks.
Mikhail.

From: James Pratt 
[mailto:jpr...@norwich.edu]mailto:[mailto:jpr...@norwich.edu]
Sent: Friday, March 30, 2012 9:53 AM
To: Nagios Users List
Subject: Re: [Nagios-users] how to associate /bin/bash with shell script in 
Nagios

I'm slightly confused - Do you have #!/bin/bash in the top of your shell 
script, and is it set to be executable by (at least) the nagios user?  (Not 
sure why you are calling bash then the script name as an arg, that is odd to 
me, but maybe I'm missing something)?

Cheers,
Jamie

From: Parkman, Mikhail

[Nagios-users] Status Information (null) - using Syabru Nagios Message Broker

2012-03-27 Thread Parkman, Mikhail
Hello,

I am trying to use nagios-msg-broker-0.0.4 from
http://snippets.syabru.ch/nagios-msg-broker/.
I  unzipped plugin and moved to the the /usr/local/nagios/libexec directory

nagios-msg-broker.sh   # file
config.xml   #file
lib   #directory

content of the nagios-msg-broker.sh file is
=
#!/bin/sh

java -DnagiosCommandFile=/usr/local/nagios/var/rw/nagios.cmd \
 -DconfigFile=./config.xml \
 -jar lib/nagios-msg-broker-0.0.4.jar
==
Content of the config.xml file is
=
?xml version=1.0 encoding=UTF-8?
nmb:xmlConfiguration xmlns:nmb=http://www.syabru.ch/nagios-msg-broker/1.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=
http://www.syabru.ch/nagios-msg-broker/1.0

http://snippets.syabru.ch/nagios-msg-broker/schema/nagios-msg-broker-1_0.xsd;

  nmb:jmx
nmb:mBeanServer
  
nmb:jmxServiceUrlservice:jmx:rmi:///jndi/rmi://mypc.abc-d.efg..net:1090/jmxrmi/nmb:jmxServiceUrl
  nmb:notification

nmb:objectNamecom..cvs.dlg:name=alert.DlgAlerts/nmb:objectName
nmb:match/
nmb:action
  nmb:processServiceCheckResult
nmb:hostNamelocalhost/nmb:hostName
nmb:serviceDescriptionprocessServiceCheckResult: UsageStats 
passive check/nmb:serviceDescription
nmb:returnCode0/nmb:returnCode
nmb:pluginOutputPassive check is OK/nmb:pluginOutput
  /nmb:processServiceCheckResult
  nmb:scheduleServiceCheck
nmb:hostNamelocalhost/nmb:hostName
nmb:serviceDescriptionscheduleServiceCheck - serviceDescription: 
UsageStats passive check/nmb:serviceDescription
  /nmb:scheduleServiceCheck
/nmb:action
  /nmb:notification
/nmb:mBeanServer
  /nmb:jmx

/nmb:xmlConfiguration
=
When I run manually from /usr/local/nagios/libexec

./ nagios-msg-broker.sh

I get the output:
===
[root@mypc libexec]$ ./nagios-msg-broker.sh
2012-03-27 17:22:46,908 INFO  ConfigurationImpl - Reading configuration [file 
[/usr/local/nagios/libexec/./config.xml]])
2012-03-27 17:22:46,933 DEBUG ConfigurationImpl - Created JMX listener 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
com..cvs.dlg:name=alert.DlgAlerts]
2012-03-27 17:22:46,935 DEBUG ConfigurationImpl - Created matcher 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
ProcessServiceCheckResultCommandFactory]
2012-03-27 17:22:46,935 DEBUG ConfigurationImpl - Created matcher 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
ScheduleServiceCheckCommandFactory]
2012-03-27 17:22:47,081 INFO  Version - Syabru Nagios Message Broker - Version 
0.0.4
2012-03-27 17:22:47,081 INFO  Version - Copyright 2010 - 2012 Felix 
Roethenbacher
2012-03-27 17:22:47,396 INFO  JmxMessageListener - Registered JMX notification 
listener [JMX listener service:jmx:rmi:///jndi/rmi:// 
mypc.abc-d.efg..net:1090/jmxrmi, 
com..cvs.dlg:name=alert.DlgAlerts]
2012-03-27 17:22:55,979 DEBUG MessageHandlerImpl - Message received 
[ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,980 DEBUG JmxMatcher - Message matched 
[classNamePattern=.*, messagePattern=.*, typePattern=.*, sourcePattern=.*, 
message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,981 DEBUG JmxMatcher - Message matched 
[classNamePattern=.*, messagePattern=.*, typePattern=.*, sourcePattern=.*, 
message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,982 DEBUG MessageHandlerImpl - Matching actions found: 2
2012-03-27 17:22:55,982 DEBUG ProcessServiceCheckResultCommand - [1332894175] 
PROCESS_SERVICE_CHECK_RESULT;localhost;processServiceCheckResult: UsageStats 
passive check;0;Passive check is OK

2012-03-27 17:22:55,982 DEBUG ScheduleServiceCheckCommand - [1332894175] 
SCHEDULE_SVC_CHECK;localhost;scheduleServiceCheck - serviceDescription: 
UsageStats passive check;1332894175

2012-03-27 17:23:05,968 DEBUG MessageHandlerImpl - Message received 
[ch.syabru.nagios.broker.jmx.JmxMessage@694b081b[className=javax.management.Notification,message=No
 requests received from any CASMR for 2205 
ms.,type=NoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
=
From /usr/local/nagios/objects /commands.cfg on the monitoring 

Re: [Nagios-users] Status Information (null) - using Syabru Nagios Message Broker

2012-03-27 Thread Parkman, Mikhail
Nagios(r) Core(tm)
Version 3.3.1

nagios-msg-broker-0.0.4

OS on monitoring and target machines:
[root@perfserver-10 nagios]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
[root@perfserver-10 nagios]$


From: Parkman, Mikhail [mailto:mikhail_park...@cable.comcast.com]
Sent: Tuesday, March 27, 2012 6:02 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Status Information (null) - using Syabru Nagios Message 
Broker

Hello,

I am trying to use nagios-msg-broker-0.0.4 from
http://snippets.syabru.ch/nagios-msg-broker/.
I  unzipped plugin and moved to the the /usr/local/nagios/libexec directory

nagios-msg-broker.sh   # file
config.xml   #file
lib   #directory

content of the nagios-msg-broker.sh file is
=
#!/bin/sh

java -DnagiosCommandFile=/usr/local/nagios/var/rw/nagios.cmd \
 -DconfigFile=./config.xml \
 -jar lib/nagios-msg-broker-0.0.4.jar
==
Content of the config.xml file is
=
?xml version=1.0 encoding=UTF-8?
nmb:xmlConfiguration xmlns:nmb=http://www.syabru.ch/nagios-msg-broker/1.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=
http://www.syabru.ch/nagios-msg-broker/1.0

http://snippets.syabru.ch/nagios-msg-broker/schema/nagios-msg-broker-1_0.xsd;

  nmb:jmx
nmb:mBeanServer
  
nmb:jmxServiceUrlservice:jmx:rmi:///jndi/rmi://mypc.abc-d.efg..net:1090/jmxrmi/nmb:jmxServiceUrl
  nmb:notification

nmb:objectNamecom..cvs.dlg:name=alert.DlgAlerts/nmb:objectName
nmb:match/
nmb:action
  nmb:processServiceCheckResult
nmb:hostNamelocalhost/nmb:hostName
nmb:serviceDescriptionprocessServiceCheckResult: UsageStats 
passive check/nmb:serviceDescription
nmb:returnCode0/nmb:returnCode
nmb:pluginOutputPassive check is OK/nmb:pluginOutput
  /nmb:processServiceCheckResult
  nmb:scheduleServiceCheck
nmb:hostNamelocalhost/nmb:hostName
nmb:serviceDescriptionscheduleServiceCheck - serviceDescription: 
UsageStats passive check/nmb:serviceDescription
  /nmb:scheduleServiceCheck
/nmb:action
  /nmb:notification
/nmb:mBeanServer
  /nmb:jmx

/nmb:xmlConfiguration
=
When I run manually from /usr/local/nagios/libexec

./ nagios-msg-broker.sh

I get the output:
===
[root@mypc libexec]$ ./nagios-msg-broker.sh
2012-03-27 17:22:46,908 INFO  ConfigurationImpl - Reading configuration [file 
[/usr/local/nagios/libexec/./config.xml]])
2012-03-27 17:22:46,933 DEBUG ConfigurationImpl - Created JMX listener 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
com..cvs.dlg:name=alert.DlgAlerts]
2012-03-27 17:22:46,935 DEBUG ConfigurationImpl - Created matcher 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
ProcessServiceCheckResultCommandFactory]
2012-03-27 17:22:46,935 DEBUG ConfigurationImpl - Created matcher 
[service:jmx:rmi:///jndi/rmi:// mypc.abc-d.efg..net:1090/jmxrmi, 
ScheduleServiceCheckCommandFactory]
2012-03-27 17:22:47,081 INFO  Version - Syabru Nagios Message Broker - Version 
0.0.4
2012-03-27 17:22:47,081 INFO  Version - Copyright 2010 - 2012 Felix 
Roethenbacher
2012-03-27 17:22:47,396 INFO  JmxMessageListener - Registered JMX notification 
listener [JMX listener service:jmx:rmi:///jndi/rmi:// 
mypc.abc-d.efg..net:1090/jmxrmi, 
com..cvs.dlg:name=alert.DlgAlerts]
2012-03-27 17:22:55,979 DEBUG MessageHandlerImpl - Message received 
[ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,980 DEBUG JmxMatcher - Message matched 
[classNamePattern=.*, messagePattern=.*, typePattern=.*, sourcePattern=.*, 
message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Requestmailto:message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,981 DEBUG JmxMatcher - Message matched 
[classNamePattern=.*, messagePattern=.*, typePattern=.*, sourcePattern=.*, 
message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Requestmailto:message=ch.syabru.nagios.broker.jmx.JmxMessage@74b9a74[className=javax.management.Notification,message=Request
 received from CASMR, clearing 
alert,type=ClearNoCasmrRequestReceived,source=com..cvs.dlg:name=alert.DlgAlerts]]
2012-03-27 17:22:55,982 DEBUG MessageHandlerImpl - Matching actions found: 2
2012-03-27 17:22:55,982 DEBUG ProcessServiceCheckResultCommand