I solved this problem. I delete group admins from templates and it begun work. But now I have another problev. Notifications works for email and perl sendxmpp scripts but doens't work for script xsend.py (script on python). If I run this script from terminal, it works, I see message. But if I run it from nagios I see exception in /var/log/messages:
Code: Select all
Dec 17 11:38:38 mon-27 nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;192.168.50.16;TRAP;2;Test message
Dec 17 11:38:38 mon-27 nagios: PASSIVE SERVICE CHECK: test-Misha;TRAP;2;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE ALERT: test-Misha;TRAP;CRITICAL;HARD;1;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: Bayburin Ravil;test-Misha;TRAP;CRITICAL;mc-ravil-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: Bayburin Ravil;test-Misha;TRAP;CRITICAL;Bayburin-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: Bayburin Ravil;test-Misha;TRAP;CRITICAL;notify-service-by-email;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;mc-misha-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;operator4-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;operator3-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;operator2-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;operator1-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;plazma2-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;plazma1-service;Test message
Dec 17 11:38:38 mon-27 nagios: SERVICE NOTIFICATION: main-contact;test-Misha;TRAP;CRITICAL;main-plazma-service;Test message
Dec 17 11:38:44 mon-27 abrt: detected unhandled Python exception in '/usr/local/nagios/libexec/xsend.py'
Dec 17 11:38:44 mon-27 abrtd: New client connected
Dec 17 11:38:44 mon-27 abrt-server[22556]: Saved Python crash dump of pid 22524 to /var/spool/abrt/pyhook-2014-12-17-11:38:44-22524
Dec 17 11:38:44 mon-27 abrtd: Directory 'pyhook-2014-12-17-11:38:44-22524' creation detected
Dec 17 11:38:44 mon-27 nagios: wproc: NOTIFY job 14 from worker Core Worker 22415 is a non-check helper but exited with return code 1
Dec 17 11:38:44 mon-27 nagios: wproc: host=test-Misha; service=TRAP; contact=main-contact
Dec 17 11:38:44 mon-27 nagios: wproc: early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 01: /usr/lib/python2.6/site-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 02: import sha,base64,random,dispatcher,re
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 03: /usr/lib/python2.6/site-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 04: import md5
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 05: /usr/lib/python2.6/site-packages/xmpp/transports.py:315: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 06: tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 07: Traceback (most recent call last):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 08: File "/usr/local/nagios/libexec/xsend.py", line 32, in <module>
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 09: auth=cl.auth(jid.getNode(),'password',resource=jid.getResource())
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 10: File "/usr/lib/python2.6/site-packages/xmpp/client.py", line 229, in auth
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 11: if self.Bind.Bind(resource):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 12: File "/usr/lib/python2.6/site-packages/xmpp/auth.py", line 252, in Bind
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 13: resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})]))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 14: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 337, in SendAndWaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 15: return self.WaitForResponse(self.send(stanza),timeout)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 16: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 321, in WaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 17: if not self.Process(0.04):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 18: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 303, in dispatch
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 19: handler['func'](session,stanza)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 20: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 215, in streamErrorHandler
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 21: raise exc((name,text))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 22: xmpp.protocol.Conflict: (u'conflict', '')
Dec 17 11:38:44 mon-27 abrtd: Executable '/usr/local/nagios/libexec/xsend.py' doesn't belong to any package and ProcessUnpackaged is set to 'no'
Dec 17 11:38:44 mon-27 abrtd: 'post-create' on '/var/spool/abrt/pyhook-2014-12-17-11:38:44-22524' exited with 1
Dec 17 11:38:44 mon-27 abrtd: Deleting problem directory '/var/spool/abrt/pyhook-2014-12-17-11:38:44-22524'
Dec 17 11:38:44 mon-27 abrt: detected unhandled Python exception in '/usr/local/nagios/libexec/xsend.py'
Dec 17 11:38:44 mon-27 abrtd: New client connected
Dec 17 11:38:44 mon-27 abrt-server[22559]: Not saving repeating crash in '/usr/local/nagios/libexec/xsend.py'
Dec 17 11:38:44 mon-27 nagios: wproc: NOTIFY job 15 from worker Core Worker 22415 is a non-check helper but exited with return code 1
Dec 17 11:38:44 mon-27 nagios: wproc: host=test-Misha; service=TRAP; contact=main-contact
Dec 17 11:38:44 mon-27 nagios: wproc: early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 01: /usr/lib/python2.6/site-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 02: import sha,base64,random,dispatcher,re
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 03: /usr/lib/python2.6/site-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 04: import md5
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 05: /usr/lib/python2.6/site-packages/xmpp/transports.py:315: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 06: tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 07: Traceback (most recent call last):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 08: File "/usr/local/nagios/libexec/xsend.py", line 32, in <module>
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 09: auth=cl.auth(jid.getNode(),'password',resource=jid.getResource())
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 10: File "/usr/lib/python2.6/site-packages/xmpp/client.py", line 229, in auth
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 11: if self.Bind.Bind(resource):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 12: File "/usr/lib/python2.6/site-packages/xmpp/auth.py", line 252, in Bind
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 13: resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})]))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 14: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 337, in SendAndWaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 15: return self.WaitForResponse(self.send(stanza),timeout)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 16: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 321, in WaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 17: if not self.Process(0.04):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 18: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 303, in dispatch
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 19: handler['func'](session,stanza)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 20: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 215, in streamErrorHandler
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 21: raise exc((name,text))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 22: xmpp.protocol.Conflict: (u'conflict', '')
Dec 17 11:38:44 mon-27 abrt: detected unhandled Python exception in '/usr/local/nagios/libexec/xsend.py'
Dec 17 11:38:44 mon-27 abrtd: New client connected
Dec 17 11:38:44 mon-27 abrt-server[22560]: Not saving repeating crash in '/usr/local/nagios/libexec/xsend.py'
Dec 17 11:38:44 mon-27 nagios: wproc: NOTIFY job 14 from worker Core Worker 22413 is a non-check helper but exited with return code 1
Dec 17 11:38:44 mon-27 nagios: wproc: host=test-Misha; service=TRAP; contact=main-contact
Dec 17 11:38:44 mon-27 nagios: wproc: early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 01: /usr/lib/python2.6/site-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 02: import sha,base64,random,dispatcher,re
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 03: /usr/lib/python2.6/site-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 04: import md5
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 05: /usr/lib/python2.6/site-packages/xmpp/transports.py:315: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 06: tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 07: Traceback (most recent call last):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 08: File "/usr/local/nagios/libexec/xsend.py", line 32, in <module>
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 09: auth=cl.auth(jid.getNode(),'password',resource=jid.getResource())
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 10: File "/usr/lib/python2.6/site-packages/xmpp/client.py", line 229, in auth
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 11: if self.Bind.Bind(resource):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 12: File "/usr/lib/python2.6/site-packages/xmpp/auth.py", line 252, in Bind
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 13: resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})]))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 14: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 337, in SendAndWaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 15: return self.WaitForResponse(self.send(stanza),timeout)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 16: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 321, in WaitForResponse
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 17: if not self.Process(0.04):
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 18: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 303, in dispatch
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 19: handler['func'](session,stanza)
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 20: File "/usr/lib/python2.6/site-packages/xmpp/dispatcher.py", line 215, in streamErrorHandler
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 21: raise exc((name,text))
Dec 17 11:38:44 mon-27 nagios: wproc: stderr line 22: xmpp.protocol.Conflict: (u'conflict', '')
And every time it work for different notification receiver. For example, in first time it work for main-plazma-service, operator3-service and mc-ravil-service. Second time it work for only Bayburin-service and mc-misha-service.
In nagios 3.5 I dont see this exception and everythink work fine.
Also I see this message:
Code: Select all
Dec 17 15:18:55 mon-27 nagios: Warning: Notifying contact 'main-plazma' of service 'TRAP' on host 'test-Misha' by command '/usr/local/nagios/libexec/xsend.py test@xmpp "PROBLEM ,^! test-Misha ,^! 1-1 ,^! TRAP ,^! CRITICAL ,^! Test message "' timed out after 0.00 seconds
What is timed out after 0.00 seconds? Why time out?
Code: Select all
[root@mon-27 snmp]# ls -l /usr/local/nagios/libexec/xsend.py
-rwxr-xr-x. 1 nagios nagios 1377 Дек 17 11:27 /usr/local/nagios/libexec/xsend.py
Once again, that the script works from the terminal.
Code: Select all
[nagios@mon-27 libexec]$./xsend.py user1@xmpp "Test message"
/usr/lib/python2.6/site-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha,base64,random,dispatcher,re
/usr/lib/python2.6/site-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
/usr/lib/python2.6/site-packages/xmpp/transports.py:315: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
This is only warning and it is normal state. After ./xsend.py user1@xmpp "Test message" command I see "Test message" in xmpp-server. And I cant undesrand, why it doesnt work on nagios 4.0.2. On nagios 3.5.1 it work fine and notifications is work and there aren't these exception.
Help, please. Why notifications doesn't work?