Re: [Nagios-users] Custom command, works from command line, not from nagios?

2011-01-13 Thread Clyde Jones
Mister IT Guru  wrote:
> I run this command from the cli
> 
> [root@host ~]# /usr/lib/nagios/plugins/check_nrpe -H
client.localdomain -c get_disk -a localhost C: 70,80
> 
> And I get the response above. I defined the command below,
> 
> define command{
>  command_namecheck_cdrive
>  command_line$USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80

> } 
> 
> and also this service,
> 
> define service{
> 
>  usegeneric-service; Inherit default
> values from a
> template
>  hostgroup_nameWindows_Servers
>  service_descriptionC Drive Space
>  check_commandcheck_cdrive
>  }
> 
> And I get this response when nagios runs the checks.
> 
> Status Information:(Return code of 127 is out of bounds - plugin
may
> be missing)
> 
> 

You are asking Nagios to run a non-existing command.  What you have
defined in the nagios command is NOT what you ran on the command line.  

Your command should be: 
   define command{
 command_namecheck_cdrive
 # Wrong command_line$USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80

 command_line$USER1$/check_nrpe $HOSTADDRESS$ -c
get_disk -a localhost C: 70,80 
   } 

-- 
Clyde Jones
R&D Informatics
Senior Applications Engineer
cjo...@exelixis.com
Exelixis Inc
650 837 7085 Office
650 228 4699 Cell

This email (including any attachments) may contain material
that is confidential and privileged and is for the sole use of
the intended recipient. Any review, reliance or distribution by
others or forwarding without express permission is strictly
prohibited. If you are not the intended recipient, please
contact the sender and delete all copies.
Exelixis, Inc. reserves the right, to the extent and under
circumstances permitted by applicable law, to retain, monitor
and intercept e-mail messages to and from its systems.


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
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] Custom command, works from command line, not from nagios? [SOLVED]

2011-01-10 Thread Mister IT Guru
On 08/01/2011 14:09, Leif J. wrote:
> Den 08-01-2011 14:51, Mister IT Guru skrev:
>> On 08/01/2011 13:40, Leif J. wrote:
>>> I'm confused in CLI you are using:
>>>
>>> /usr/lib/nagios/plugins/check_nrpe -H client.localdomain
>>> -c get_disk -a localhost C: 70,80
>>>
>>> but in the define command you are using:
>>>
>>> $USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80
>>>
>>>
>>>
>>> In your define command I would define it as:
>>>
>>> /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c get_disk -a 
>>> localhost C: 70,80
>>>
>>>
>>> And then define the command in nrpe on the windows box
>>>
>> I had no idea that I could do that!? I feel so stupid! Thanks for the tip!
> I always take the exactly path to make sure what command it are using.

By using the absolute path, I was able to get everything working, Thank 
you :)

-- 
The Solo System Admin
http://solosysad.blogspot.com/
--
Mister IT Guru At Gmx Dot Com


--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
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] Custom command, works from command line, not from nagios?

2011-01-08 Thread Leif J.
Den 08-01-2011 14:51, Mister IT Guru skrev:
> On 08/01/2011 13:40, Leif J. wrote:
>> I'm confused in CLI you are using:
>>
>> /usr/lib/nagios/plugins/check_nrpe -H client.localdomain
>> -c get_disk -a localhost C: 70,80
>>
>> but in the define command you are using:
>>
>> $USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80
>>
>>
>>
>> In your define command I would define it as:
>>
>> /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c get_disk -a localhost 
>> C: 70,80
>>
>>
>> And then define the command in nrpe on the windows box
>>
> I had no idea that I could do that!? I feel so stupid! Thanks for the tip!

I always take the exactly path to make sure what command it are using.

--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
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] Custom command, works from command line, not from nagios?

2011-01-08 Thread Mister IT Guru
On 08/01/2011 13:40, Leif J. wrote:
> I'm confused in CLI you are using:
>
> /usr/lib/nagios/plugins/check_nrpe -H client.localdomain
> -c get_disk -a localhost C: 70,80
>
> but in the define command you are using:
>
> $USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80
>
>
>
> In your define command I would define it as:
>
> /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c get_disk -a localhost 
> C: 70,80
>
>
> And then define the command in nrpe on the windows box
>
I had no idea that I could do that!? I feel so stupid! Thanks for the tip!

--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
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] Custom command, works from command line, not from nagios?

2011-01-08 Thread Leif J.
I'm confused in CLI you are using:

/usr/lib/nagios/plugins/check_nrpe -H client.localdomain
-c get_disk -a localhost C: 70,80

but in the define command you are using:

$USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80



In your define command I would define it as:

/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c get_disk -a localhost C: 
70,80


And then define the command in nrpe on the windows box


Den 08-01-2011 14:22, Mister IT Guru skrev:
> I run this command from the cli
>
> [r...@host ~]# /usr/lib/nagios/plugins/check_nrpe -H client.localdomain
> -c get_disk -a localhost C: 70,80
>
> OK - C: 'Percentage Space Used' = 54; |'C'=54;70;80;
>
> And I get the response above. I defined the command below,
>
> define command{
>   command_namecheck_cdrive
>   command_line$USER1$/get_disk -a  $HOSTADDRESS$ C: 70,80
>   }
>
> and also this service,
>
> define service{
>
>   usegeneric-service; Inherit default values from a
> template
>   hostgroup_nameWindows_Servers
>   service_descriptionC Drive Space
>   check_commandcheck_cdrive
>   }
>
> And I get this response when nagios runs the checks.
>
> Status Information:(Return code of 127 is out of bounds - plugin may
> be missing)
>
>
> The target client is a windows box, running nrpe_nt -
>
> Any ideas, as to where I'm going wrong, are appreciated :)
>
> --
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web.   Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> ___
> 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


--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
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] Custom command

2006-02-02 Thread Jim Pye
Robert,

One thing I discovered with the script is that it uses the alarm()
functionality of the Linux kernel to help catch communication time outs.
Both Windows (and NetWare) do not support this functionality in their
PERL implementations. The script does account for Windows (I had to
modify it for NetWare) by detecting the OS and turning off that
function.

I am wondering if FreeBSD implementation of this alert function is not
working correctly. Or as the program works when running at commandline
that a permissions issue is being seen with this function. I do not have
a freeBSD to try the script on myself.

Not sure of your hacking skills but the lines that involve this alarm()
call are documented in the code and all I did for NetWare was add to the
OS test, at each of the places where it tests for Windows (about 5 or
6), the string returned by NetWare.

HTH
Jim


On Thu, 2006-02-02 at 10:21 -0500, Robert Fitzpatrick wrote:
> Thanks to Jim here on the list, I have defined a command to send an
> e-mail using a sendEmail perl script. From the command line, the script
> works fine. When I try to use the new notify-by-sendEmail as the
> service_notification_commands for my contact, Nagios logs the message as
> sent, which never makes it to the SMTP server and I get this error in
> the /var/log/messages:
> 
> Feb  2 10:13:39 esmtp kernel: pid 14486 (nagios), uid 2004: exited on
> signal 10
> 
> I have the same permissions on the file as the other commands that
> Nagios uses in the minimail.cfg, like /usr/bin/mail:
> 
> esmtp# ls -lah /usr/local/bin/sendEmail
> -r-xr-xr-x  1 root  wheel62K Feb  1 17:58 /usr/local/bin/sendEmail
> 
> Can someone suggest why I get this error? I simplified the new command
> without the variables like below, I can copy and paste this command to
> the command line and the message gets sent successfully:
> 
> define command{
> command_namenotify-by-sendEmail
> command_line/usr/local/bin/sendEmail -f
> [EMAIL PROTECTED] -t [EMAIL PROTECTED] -s 10.0.0.40 -m "Body" -u
> "Subject"
> }
> 
> define contact{
> contact_namewebtent
> alias   WebTent
> service_notification_period 24x7
> host_notification_period24x7
> service_notification_optionsw,u,c,r
> host_notification_options   d,r
> service_notification_commands   notify-by-sendEmail
> host_notification_commands  host-notify-by-email
> email   [EMAIL PROTECTED]
> }
> 
> 
-- 
Jim Pye
PyeNet Universal

email: [EMAIL PROTECTED] | Phone: +64 4 527 8284 | Fax: +64 4 528 9693
 web site: http://www.pyenet.co.nz



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
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] Custom command

2006-02-02 Thread Tedman Eng
Are you testing from commandline from the context of the nagios user?

> -Original Message-
> From: Robert Fitzpatrick [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 02, 2006 7:22 AM
> To: Nagios
> Subject: [Nagios-users] Custom command
> 
> 
> Thanks to Jim here on the list, I have defined a command to send an
> e-mail using a sendEmail perl script. From the command line, 
> the script
> works fine. When I try to use the new notify-by-sendEmail as the
> service_notification_commands for my contact, Nagios logs the 
> message as
> sent, which never makes it to the SMTP server and I get this error in
> the /var/log/messages:
> 
> Feb  2 10:13:39 esmtp kernel: pid 14486 (nagios), uid 2004: exited on
> signal 10
> 
> I have the same permissions on the file as the other commands that
> Nagios uses in the minimail.cfg, like /usr/bin/mail:
> 
> esmtp# ls -lah /usr/local/bin/sendEmail
> -r-xr-xr-x  1 root  wheel62K Feb  1 17:58 /usr/local/bin/sendEmail
> 
> Can someone suggest why I get this error? I simplified the new command
> without the variables like below, I can copy and paste this command to
> the command line and the message gets sent successfully:
> 
> define command{
> command_namenotify-by-sendEmail
> command_line/usr/local/bin/sendEmail -f
> [EMAIL PROTECTED] -t [EMAIL PROTECTED] -s 10.0.0.40 
> -m "Body" -u
> "Subject"
> }
> 
> define contact{
> contact_namewebtent
> alias   WebTent
> service_notification_period 24x7
> host_notification_period24x7
> service_notification_optionsw,u,c,r
> host_notification_options   d,r
> service_notification_commands   notify-by-sendEmail
> host_notification_commands  host-notify-by-email
> email   [EMAIL PROTECTED]
> }
> 
> 
> -- 
> Robert
> 
> 
> 
> ---
> This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&;
dat=121642
___
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


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
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] Custom command

2006-02-02 Thread Robert Fitzpatrick
On Thu, 2006-02-02 at 17:44 +0200, Assaf Flatto wrote:
> Have you tried placing the script under the libexec directory?
> 
> I had the same issue some time ago and the script only worked when it was in 
> the 
> libexec directory even though the absolute path was set.

Thanks, but still same error even with the new location :(

Jim suggested this on the list, so I know it can be done. I'm on a
FreeBSD 5.4 server. Anyone ever have issues with getting custom commands
to run...?

-- 
Robert



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
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] Custom command

2006-02-02 Thread Assaf Flatto

Have you tried placing the script under the libexec directory?

I had the same issue some time ago and the script only worked when it was in the 
libexec directory even though the absolute path was set.



Assaf

Robert Fitzpatrick wrote:

Thanks to Jim here on the list, I have defined a command to send an
e-mail using a sendEmail perl script. From the command line, the script
works fine. When I try to use the new notify-by-sendEmail as the
service_notification_commands for my contact, Nagios logs the message as
sent, which never makes it to the SMTP server and I get this error in
the /var/log/messages:

Feb  2 10:13:39 esmtp kernel: pid 14486 (nagios), uid 2004: exited on
signal 10

I have the same permissions on the file as the other commands that
Nagios uses in the minimail.cfg, like /usr/bin/mail:

esmtp# ls -lah /usr/local/bin/sendEmail
-r-xr-xr-x  1 root  wheel62K Feb  1 17:58 /usr/local/bin/sendEmail

Can someone suggest why I get this error? I simplified the new command
without the variables like below, I can copy and paste this command to
the command line and the message gets sent successfully:

define command{
command_namenotify-by-sendEmail
command_line/usr/local/bin/sendEmail -f
[EMAIL PROTECTED] -t [EMAIL PROTECTED] -s 10.0.0.40 -m "Body" -u
"Subject"
}

define contact{
contact_namewebtent
alias   WebTent
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsw,u,c,r
host_notification_options   d,r
service_notification_commands   notify-by-sendEmail
host_notification_commands  host-notify-by-email
email   [EMAIL PROTECTED]
}




--
Assaf Flatto
m-Wise Operations
Cellular: +972-54-5679230
e-mail: [EMAIL PROTECTED]
MSN : [EMAIL PROTECTED]


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
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