Re: [Nagios-users] snmptt and nagios, access to nagios.cmd file
They look like this: For nagios.cmd prw-rw 1 nagios nagcmd0 2009-03-11 18:53 nagios.cmd for the rw catalog: drwxrwsr-x 2 nagios nagcmd 4096 2009-03-11 18:14 rw Please let me know if something looks obviously wrong. //Marco On Wed, Mar 11, 2009 at 8:12 PM, Jim Avery j...@jimavery.me.uk wrote: 2009/3/11 Marco Tirado marco.tir...@gmail.com: My snmptt.conf file for the trap I am testing looks like: EVENT ospfOriginateLsa .1.3.6.1.2.1.14.16.2.0.12 Status Events Normal FORMAT $D. $Fn VARIABLE VALUES: $-* EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result myhost snmp_traps 1 My text message /tmp/OutputTest 21 SDESC ... EDESC And my nagios configuration is correct as I can see the passive check results in my nagios console if I run the above EXEC command from the command line as user snmptt. //Marco I'm sorry if this question sounds stupid, but what are the permissions and ownership on /usr/local/nagios/var/rw and /usr/local/nagios/var/rw/nagios.cmd ? -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
2009/3/12 Marco Tirado marco.tir...@gmail.com: They look like this: For nagios.cmd prw-rw 1 nagios nagcmd 0 2009-03-11 18:53 nagios.cmd for the rw catalog: drwxrwsr-x 2 nagios nagcmd 4096 2009-03-11 18:14 rw Please let me know if something looks obviously wrong. No, those look absolutely fine; same as mine anyway. I now use NagTrap with Nagios 3, but I still have a similar setup to yours running on my old Nagios 2.7 server. Let me see ... There, I have the user snmptt added to the nagiocmd group, and at the end of my submit_check_result script, I have: sg nagiocmd -c echo '$cmdline' $CommandFile It's been a while since I set this up, so my memory is a bit hazy but I think I remember now battling with this one for a while when I set it up too. I think the important thing which got it working was putting the sg nagiocmd -c (or in your case it would be sg nagcmd -c ) in front of the command which actually writes to the command file. hth, Jim -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
p.s. I'd be interested to know what instructions you followed to get your method working? I moved to using NagTrap because I found that maintaining the submit_check_result script was rather time-consuming, but if things have moved on a bit since I last set mine up I'd be interested to see if it's any easier to maintain now. I quite like NagTrap, but if you follow the standard install for it, there's a lot of polling the database which is very cpu intensive compared with writing direct to the command file as you do. Also, the alerts aren't so meaningful with NagTrap as they are in your setup. Cheers, Jim -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
Hello Jim: Thank you very much for the help, after changing the last line in the submit_check_result script from the default of: `$echocmd $cmdline $CommandFile` to: sg nagiocmd -c echo '$cmdline' $CommandFile everything works fine. As for my setup, I run nagios 3 and Nagtrap. However I send the notifications as passive checks directly from snmptt's EXEC statement. I some special logic in my script to select the right alarm level and then send it to nagios with submit_check_result. I link to nagtrap using the action_url in all my snmptrap services. I catch all the traps in Nagtrap, however only some of them generate alarms. Whenever an alarm is generated by the selected traps, you can always check the rest of received traps in nagtrap. Regards Marco On Thu, Mar 12, 2009 at 2:11 PM, Jim Avery j...@jimavery.me.uk wrote: p.s. I'd be interested to know what instructions you followed to get your method working? I moved to using NagTrap because I found that maintaining the submit_check_result script was rather time-consuming, but if things have moved on a bit since I last set mine up I'd be interested to see if it's any easier to maintain now. I quite like NagTrap, but if you follow the standard install for it, there's a lot of polling the database which is very cpu intensive compared with writing direct to the command file as you do. Also, the alerts aren't so meaningful with NagTrap as they are in your setup. Cheers, Jim -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
2009/3/12 Marco Tirado marco.tir...@gmail.com: Hello Jim: Thank you very much for the help, after changing the last line in the submit_check_result script from the default of: `$echocmd $cmdline $CommandFile` to: sg nagiocmd -c echo '$cmdline' $CommandFile everything works fine. As for my setup, I run nagios 3 and Nagtrap. However I send the notifications as passive checks directly from snmptt's EXEC statement. I some special logic in my script to select the right alarm level and then send it to nagios with submit_check_result. I link to nagtrap using the action_url in all my snmptrap services. I catch all the traps in Nagtrap, however only some of them generate alarms. Whenever an alarm is generated by the selected traps, you can always check the rest of received traps in nagtrap. Regards Marco Thanks Marco, I think I'm going to have to 'bite the bullet' and do something similar myself soon. Cheers, Jim -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
My snmptt.conf file for the trap I am testing looks like: EVENT ospfOriginateLsa .1.3.6.1.2.1.14.16.2.0.12 Status Events Normal FORMAT $D. $Fn VARIABLE VALUES: $-* EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result myhost snmp_traps 1 My text message /tmp/OutputTest 21 SDESC ... EDESC And my nagios configuration is correct as I can see the passive check results in my nagios console if I run the above EXEC command from the command line as user snmptt. //Marco On Wed, Mar 11, 2009 at 6:10 PM, Marco Tirado marco.tir...@gmail.comwrote: Hello Users: I am having touble integrating nagios with snmptt, it seems that the snmptt daemon can not write passive check results to the /usr/local/nagios/var/rw/nagios.cmd file. I get the following error: cannot create /usr/local/nagios/var/rw/nagios.cmd: Permission denied The wierd thing is that I have added the snmptt user to the nagcmd group. I can actually run the EXEC command from the console and manually send the check results by running: /usr/local/nagios/libexec/eventhandlers/submit_check_result myhost snmp_traps 1 My text message as the snmptt user. But when the snmptt tries to run it when a trap is received I get the above error. Any suggestions or recommendations are deeply appreciated //Marco -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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] snmptt and nagios, access to nagios.cmd file
2009/3/11 Marco Tirado marco.tir...@gmail.com: My snmptt.conf file for the trap I am testing looks like: EVENT ospfOriginateLsa .1.3.6.1.2.1.14.16.2.0.12 Status Events Normal FORMAT $D. $Fn VARIABLE VALUES: $-* EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result myhost snmp_traps 1 My text message /tmp/OutputTest 21 SDESC ... EDESC And my nagios configuration is correct as I can see the passive check results in my nagios console if I run the above EXEC command from the command line as user snmptt. //Marco I'm sorry if this question sounds stupid, but what are the permissions and ownership on /usr/local/nagios/var/rw and /usr/local/nagios/var/rw/nagios.cmd ? -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-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