Re: [Nagios-users] notification command
Yes you're right. I've cleared out the issue. It's not something about Nagios but nagiosQL. While it tries to insert the command to DB, some characters are being modified, so because the arguments that are passed to script were wrog, script cant be executed. Sorry about this, but thanks all who commented. Have a nice weekend. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Powell Sent: Saturday, December 08, 2007 12:09 AM To: Nagios Users mailinglist Subject: Re: [Nagios-users] notification command -Original Message- From: [EMAIL PROTECTED] [mailto:nagios-users- [EMAIL PROTECTED] On Behalf Of Keles, Cem Sent: Friday, December 07, 2007 2:28 PM To: Nagios Users mailinglist Subject: Re: [Nagios-users] notification command Thanks but I've tried this already, no file created unfortunately. I'm sure Nagios doesnt run script even the notification command is executed. There has never been a bug like that as far as I can recall. If nagios says it's calling it, it's calling it. It may be failing due to permissions, environment or some other external factor though. Try adding a '/tmp/logfile 21' to the end of your command definition to see STDOUT and STDERR in /tmp/logfile. Knowing what we're talking about would be useful too, please post the command definition in question, ls -l of the script(s) and directories you're referencing (i.e. the mkdir you tried), etc. -- Marc - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ 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 The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ 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] notification command
In fact I've done this like just in the beginning of script I'm using a /bin/mkdir command but script doesn't create this folder when used as nagios command. This means that nagios never runs the shell script. But in nagios log I see that it is called just after the state of check is changed. From: Valdinger, Stephen (DOV, MSX) [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 9:33 PM To: Keles, Cem; Nagios Users mailinglist Subject: RE: [Nagios-users] notification command Php codeis this launched from the web? Does mail get sent from Nagios typically? If this is launched from the web, make sure apache has execute rights to the script as well. Stephen Valdinger Dover Chemical Corporation MIS Helpdesk Guru 330.365.3622 [EMAIL PROTECTED] If a man says something in the woods and no woman hears him, is he still wrong? From: Keles, Cem [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 2:27 PM To: Nagios Users mailinglist Subject: [Nagios-users] notification command Hi, I've written a shell script which is calling a php code and I'm using this shell script as a notification command. It runs fine when tested on command line executed by both root and nagios user. But if used as nagios notification command, I cant receive any mail. Nagios logs show command is executed but in mail log I cant see any mail sent. Owner of script is the nagios user. It is being called by /bin/sh, all arguments in it is being exported. In nagios documentation it tells any command which can be run on command line can be used as a nagios misc command but I couldn't succeed sending mails. What do you think the problem is or in which log I can see why it doesn't send mails? Any help will be appreciated. Thanks Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ 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] notification command
No, it is being executed from command line like /usr/local/bin/php /path/aa.php. From: Valdinger, Stephen (DOV, MSX) [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 9:33 PM To: Keles, Cem; Nagios Users mailinglist Subject: RE: [Nagios-users] notification command Php codeis this launched from the web? Does mail get sent from Nagios typically? If this is launched from the web, make sure apache has execute rights to the script as well. Stephen Valdinger Dover Chemical Corporation MIS Helpdesk Guru 330.365.3622 [EMAIL PROTECTED] If a man says something in the woods and no woman hears him, is he still wrong? From: Keles, Cem [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 2:27 PM To: Nagios Users mailinglist Subject: [Nagios-users] notification command Hi, I've written a shell script which is calling a php code and I'm using this shell script as a notification command. It runs fine when tested on command line executed by both root and nagios user. But if used as nagios notification command, I cant receive any mail. Nagios logs show command is executed but in mail log I cant see any mail sent. Owner of script is the nagios user. It is being called by /bin/sh, all arguments in it is being exported. In nagios documentation it tells any command which can be run on command line can be used as a nagios misc command but I couldn't succeed sending mails. What do you think the problem is or in which log I can see why it doesn't send mails? Any help will be appreciated. Thanks Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ 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] notification command
Hi, I've written a shell script which is calling a php code and I'm using this shell script as a notification command. It runs fine when tested on command line executed by both root and nagios user. But if used as nagios notification command, I cant receive any mail. Nagios logs show command is executed but in mail log I cant see any mail sent. Owner of script is the nagios user. It is being called by /bin/sh, all arguments in it is being exported. In nagios documentation it tells any command which can be run on command line can be used as a nagios misc command but I couldn't succeed sending mails. What do you think the problem is or in which log I can see why it doesn't send mails? Any help will be appreciated. Thanks Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ 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] notification command
Thanks but I've tried this already, no file created unfortunately. I'm sure Nagios doesnt run script even the notification command is executed. Yes I thought that this was a script issue. But please note that this script works fine and sends mail when executed on command line by Nagios user. So the differences between command line and Nagios executed script are 2 things: - It is being executed by Nagios not manually. - I pass some Nagios values to script as argument like $CONTACTS$, $NOTIFICATIONTYPE$, $HOSTADDRESS$ etc. From: Boeckman, Matthew [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 9:59 PM To: Keles, Cem; Valdinger, Stephen (DOV, MSX); Nagios Users mailinglist Subject: RE: [Nagios-users] notification command I would echo the earlier post - add a line like : echo I ran /some/log/file to your wrapper and something simlair to your PHP script. Sounds much more like an issue in the sh script or PHP than a nagios issue. -Matthew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keles, Cem Sent: Friday, December 07, 2007 12:59 PM To: Valdinger, Stephen (DOV, MSX); Nagios Users mailinglist Subject: Re: [Nagios-users] notification command In fact I've done this like just in the beginning of script I'm using a /bin/mkdir command but script doesn't create this folder when used as nagios command. This means that nagios never runs the shell script. But in nagios log I see that it is called just after the state of check is changed. From: Valdinger, Stephen (DOV, MSX) [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 9:33 PM To: Keles, Cem; Nagios Users mailinglist Subject: RE: [Nagios-users] notification command Php codeis this launched from the web? Does mail get sent from Nagios typically? If this is launched from the web, make sure apache has execute rights to the script as well. Stephen Valdinger Dover Chemical Corporation MIS Helpdesk Guru 330.365.3622 [EMAIL PROTECTED] If a man says something in the woods and no woman hears him, is he still wrong? From: Keles, Cem [mailto:[EMAIL PROTECTED] Sent: Friday, December 07, 2007 2:27 PM To: Nagios Users mailinglist Subject: [Nagios-users] notification command Hi, I've written a shell script which is calling a php code and I'm using this shell script as a notification command. It runs fine when tested on command line executed by both root and nagios user. But if used as nagios notification command, I cant receive any mail. Nagios logs show command is executed but in mail log I cant see any mail sent. Owner of script is the nagios user. It is being called by /bin/sh, all arguments in it is being exported. In nagios documentation it tells any command which can be run on command line can be used as a nagios misc command but I couldn't succeed sending mails. What do you think the problem is or in which log I can see why it doesn't send mails? Any help will be appreciated. Thanks Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards The information contained in this message or any of its attachments may
[Nagios-users] nagios script quits with unknown error
Hi, I use Nagios 2.9. I have a vbscript running on windows servers that checks the cpu usage and outputs with performance data. Here is the output of script when executed on command prompt. Processor Time=41% |PerProc=41;60;90;0;100 The last lines of script are like this: If PercentProcessorTime warnperc Then if PercentProcessorTime critperc Then Wscript.Quit(2) 'Quit with critical Else Wscript.Quit(1) 'Quit with warning End If End If Wscript.Quit(0) 'Quit with OK So the script quits with warning or critical if those criterias in if statements are met and sure it should at least quit with ok. But most of the time I get these notifications from nagios. -- * Nagios * Notification Type: PROBLEM Service: CPU load Host: hostname Address: xx.xx.xx.xx State: UNKNOWN Date/Time: Tue Oct 9 09:25:10 CEST 2007 Additional Info: Processor Time=52% --- You see the output is ok, that it gives Processor Time=52%. My question is: Why do you think nagios gives unknown even script executes well? Any help will be greatly appreciated. KR, Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ 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] nagios script quits with unknown error
Hi again, Sorry about not writing these in the previous email. Yes, the values are correct in script. KR, Cem From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hindrek murdsalu Sent: Tuesday, October 09, 2007 11:25 AM To: nagios-users@lists.sourceforge.net Subject: Re: [Nagios-users] nagios script quits with unknown error Are you using the appropriate return codes? Const intCritical = 2 Const intWarning = 1 Const intOK = 0 Const intUnknown = 3 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keles, Cem Sent: 9. oktoober 2007. a. 10:57 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] nagios script quits with unknown error Hi, I use Nagios 2.9. I have a vbscript running on windows servers that checks the cpu usage and outputs with performance data. Here is the output of script when executed on command prompt. Processor Time=41% |PerProc=41;60;90;0;100 The last lines of script are like this: If PercentProcessorTime warnperc Then if PercentProcessorTime critperc Then Wscript.Quit(2) 'Quit with critical Else Wscript.Quit(1) 'Quit with warning End If End If Wscript.Quit(0) 'Quit with OK So the script quits with warning or critical if those criterias in if statements are met and sure it should at least quit with ok. But most of the time I get these notifications from nagios. -- * Nagios * Notification Type: PROBLEM Service: CPU load Host: hostname Address: xx.xx.xx.xx State: UNKNOWN Date/Time: Tue Oct 9 09:25:10 CEST 2007 Additional Info: Processor Time=52% --- You see the output is ok, that it gives Processor Time=52%. My question is: Why do you think nagios gives unknown even script executes well? Any help will be greatly appreciated. KR, Cem The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sonys global policies and standards- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ 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