Nagios alert Whatsapp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
ngenglala
Posts: 6
Joined: Tue Jan 24, 2017 10:28 pm

Nagios alert Whatsapp

Post by ngenglala »

Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... =7&t=41710
In the future, please create a new thread and link to the old one instead of adding on.


hello..

i using yowsup, on nagios 4.2 and install it on ubuntu 14.04

i can send message , but cannot send notif

this is my command to send a message

/usr/local/nagios/libexec/yowsup-master/yowsup-cli -c /usr/local/nagios/libexec/yowsup-master/yowsup-cli.config -s phonenumber “ test whatsapp”

this my command for the" notify-host-by-whatsapp "

/usr/local/nagios/libexec/yowsup-master/yowsup-cli -c /usr/local/nagios/libexec/yowsup-master/yowsup-cli.config -S $_CONTACTWHATSAPP$ “$NOTIFICATIONTYPE$ Host : $HOSTNAME$ is $HOSTSTATE$ @ $LONGDATETIME$”


" notify-service-by-whatsapp "

/usr/local/nagios/libexec/yowsup-master/yowsup-cli -c /usr/local/nagios/libexec/yowsup-master/yowsup-cli.config -S $_CONTACTWHATSAPP$ “$NOTIFICATIONTYPE$ Host : $HOSTNAME$ - Service : $SERVICEDESC$ is $SERVICESTATE$ @ $LONGDATETIME$”


after i check in nagios.log

i found this error

[1488771452] wproc: stderr line 01: usage: demos [-h] [-v] [-d] [--help-config] [-l phone:b64password | -c CONFIG]
[1488771452] wproc: stderr line 02: [-E {android,s40}] [-M] [-y] [-e] [-s phone message]
[1488771452] wproc: stderr line 03: [-S contacts]
[1488771452] wproc: stderr line 04: demos: error: unrecognized arguments: “PROBLEM Host : Raqa is DOWN @ Mon Mar 6 10:37:31 WIB 2017”


i still cant figure it out, what is the problem....
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios alert Whatsapp

Post by mcapra »

This is a bit out of scope since the problem doesn't appear to be Nagios related. You'd probably have better luck contacting whoever maintains yowsup-cli.

I'm guessing this has something to do with the syntax in your command. It looks as if the message sent is supposed to be preceded by -s:

Code: Select all

[-s phone message]
I do not see this argument in your notify-service-by-whatsapp definition when you're passing the message. You might try revising it like so:

Code: Select all

/usr/local/nagios/libexec/yowsup-master/yowsup-cli -c /usr/local/nagios/libexec/yowsup-master/yowsup-cli.config -S $_CONTACTWHATSAPP$ -s “$NOTIFICATIONTYPE$ Host : $HOSTNAME$ - Service : $SERVICEDESC$ is $SERVICESTATE$ @ $LONGDATETIME$”
Former Nagios employee
https://www.mcapra.com/
User avatar
ngenglala
Posts: 6
Joined: Tue Jan 24, 2017 10:28 pm

Re: Nagios alert Whatsapp

Post by ngenglala »

yeah, i mean.. not all the time we check our email to geta notification from nagios, i want the notif send it to my whatsapp...

and me using yowsup cause recommend from here to..

i got the error.log

[1488941740] wproc: stderr line 01: Traceback (most recent call last):
[1488941740] wproc: stderr line 02: File "/usr/local/nagios/libexec/yowsup-master/yowsup-cli", line 368, in <module>
[1488941740] wproc: stderr line 03: if not parser.process():
[1488941740] wproc: stderr line 04: File "/usr/local/nagios/libexec/yowsup-master/yowsup-cli", line 272, in process
[1488941740] wproc: stderr line 05: self.startSendClient()
[1488941740] wproc: stderr line 06: File "/usr/local/nagios/libexec/yowsup-master/yowsup-cli", line 314, in startSendClient
[1488941740] wproc: stderr line 07: from yowsup.demos import sendclient
[1488941740] wproc: stderr line 08: File "/usr/local/nagios/libexec/yowsup-master/yowsup/demos/sendclient/__init__.py", line 1, in <module>
[1488941740] wproc: stderr line 09: from .stack import YowsupSendStack
[1488941740] wproc: stderr line 10: File "/usr/local/nagios/libexec/yowsup-master/yowsup/demos/sendclient/stack.py", line 1, in <module>
[1488941740] wproc: stderr line 11: from yowsup.stacks import YowStackBuilder
[1488941740] wproc: stderr line 12: File "/usr/local/nagios/libexec/yowsup-master/yowsup/stacks/__init__.py", line 1, in <module>
[1488941740] wproc: stderr line 13: from .yowstack import YowStack, YowStackBuilder
[1488941740] wproc: stderr line 14: File "/usr/local/nagios/libexec/yowsup-master/yowsup/stacks/yowstack.py", line 10, in <module>
[1488941740] wproc: stderr line 15: from yowsup.layers.protocol_media import YowMediaProtocolLayer
[1488941740] wproc: stderr line 16: File "/usr/local/nagios/libexec/yowsup-master/yowsup/layers/protocol_media/__init__.py", line 1, in <module>
[1488941740] wproc: stderr line 17: from .layer import YowMediaProtocolLayer
[1488941740] wproc: stderr line 18: File "/usr/local/nagios/libexec/yowsup-master/yowsup/layers/protocol_media/layer.py", line 2, in <module>
[1488941740] wproc: stderr line 19: from .protocolentities import ImageDownloadableMediaMessageProtocolEntity
[1488941740] wproc: stderr line 20: File "/usr/local/nagios/libexec/yowsup-master/yowsup/layers/protocol_media/protocolentities/__init__.py", line 3, in <module>
[1488941740] wproc: stderr line 21: from .message_media_downloadable_image import ImageDownloadableMediaMessageProtocolEntity
[1488941740] wproc: stderr line 22: File "/usr/local/nagios/libexec/yowsup-master/yowsup/layers/protocol_media/protocolentities/message_media_downloadable_image.py$
[1488941740] wproc: stderr line 23: from yowsup.layers.protocol_messages.proto.wa_pb2 import ImageMessage
[1488941740] wproc: stderr line 24: File "/usr/local/nagios/libexec/yowsup-master/yowsup/layers/protocol_messages/proto/wa_pb2.py", line 6, in <module>
[1488941740] wproc: stderr line 25: from google.protobuf import descriptor as _descriptor
[1488941740] wproc: stderr line 26: File "/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/google/__init__.py", line 2, in <module>
[1488941740] wproc: stderr line 27: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3036, in <module>
[1488941740] wproc: stderr line 28: @_call_aside
[1488941740] wproc: stderr line 29: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in _call_aside
[1488941740] wproc: stderr line 30: f(*args, **kwargs)
[1488941740] wproc: stderr line 31: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3064, in _initialize_master_working_set
[1488941740] wproc: stderr line 32: for dist in working_set
[1488941740] wproc: stderr line 33: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3064, in <genexpr>
[1488941740] wproc: stderr line 34: for dist in working_set
[1488941740] wproc: stderr line 35: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2592, in activate
[1488941740] wproc: stderr line 36: for pkg in self._get_metadata('namespace_packages.txt'):
[1488941740] wproc: stderr line 37: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2582, in _get_metadata
[1488941740] wproc: stderr line 38: for line in self.get_metadata_lines(name):
[1488941740] wproc: stderr line 39: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1472, in get_metadata_lines
[1488941740] wproc: stderr line 40: return yield_lines(self.get_metadata(name))
[1488941740] wproc: stderr line 41: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1468, in get_metadata
[1488941740] wproc: stderr line 42: value = self._get(self._fn(self.egg_info, name))
[1488941740] wproc: stderr line 43: File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1577, in _get
[1488941740] wproc: stderr line 44: with open(path, 'rb') as stream:
[1488941740] wproc: stderr line 45: IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/EGG-INFO/namespace_package.txt

thank you
best regard
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios alert Whatsapp

Post by mcapra »

Yeah, this is pretty strictly related to something gone awry with your Python environment. I would highly recommend contacting the maintainers of the yowsup-cli package and see what they have to say about this. It looks like there may be issues with the protobuf package specifically, though I don't know enough about the application to say one way or another.
Former Nagios employee
https://www.mcapra.com/
User avatar
ngenglala
Posts: 6
Joined: Tue Jan 24, 2017 10:28 pm

Re: Nagios alert Whatsapp

Post by ngenglala »

mcapra wrote:Yeah, this is pretty strictly related to something gone awry with your Python environment. I would highly recommend contacting the maintainers of the yowsup-cli package and see what they have to say about this. It looks like there may be issues with the protobuf package specifically, though I don't know enough about the application to say one way or another.
i will do that immediately, thank you mcapra, i appreciate that
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios alert Whatsapp

Post by cdienger »

Glad we could point you in the right direction. Are we okay closing the thread at this point?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
ngenglala
Posts: 6
Joined: Tue Jan 24, 2017 10:28 pm

Re: Nagios alert Whatsapp

Post by ngenglala »

yeahh, please do that.... thank youuu

best regard
Locked