LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2016, 10:15 PM   #1
dexfcoss
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Rep: Reputation: Disabled
problem of yowsup with nagios


Hi all,
I am planning to use yowsup with nagios to send out whatsapp notification if any server down. We total have 4 admins need to notice so i created a nagios contact group including them with whatsapp check command. The yowsup sent function is normal but not all the admin received the notice. The log of nagios said that it already sent to all admins. Is any problem in my nagios config? I am using centos 6.5 64bit. Nagios version 4.1.1 and yowsup version 2.5. Below is the configuration and log of nagios. Thanks.

contact.cfg

define contact{
contact_name A
use generic-contact
alias admin_A
email XXXXXXXXX
_whatsapp XXXXXXXXX
service_notification_commands notify-service-by-whatsapp
host_notification_commands notify-host-by-whatsapp
}



define contact{
contact_name B
use generic-contact
alias admin_B
email XXXXXXXXX
_whatsapp XXXXXXXXX
service_notification_commands notify-service-by-whatsapp
host_notification_commands notify-host-by-whatsapp
}

define contact{
contact_name C
use generic-contact
alias admin_C
email XXXXXXXXX
_whatsapp XXXXXXXXX
service_notification_commands notify-service-by-whatsapp
host_notification_commands notify-host-by-whatsapp
}

define contact{
contact_name D
use generic-contact
alias admin_D
email XXXXXXXXX
_whatsapp XXXXXXXXX
service_notification_commands notify-service-by-whatsapp
host_notification_commands notify-host-by-whatsapp
}


define contactgroup{
contactgroup_name test
alias test
members A,B,C,D
}


command.cfg

define command{
command_name notify-service-by-whatsapp
command_line /usr/local/src/yowsup/yowsup-cli demos -c /usr/local/src/yowsup/nagios.conf -s $_CONTACTWHATSAPP$ "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ** ***** Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Service: $SERVICEDESC$ Host: $HOSTALIAS$ Address: $HOSTADDRESS$ State: $SERVICESTATE$ Date/Time: $LONGDATETIME$ Additional Info: $SERVICEOUTPUT$"
}

define command{
command_name notify-host-by-whatsapp
command_line /usr/local/src/yowsup/yowsup-cli demos --debug -c /usr/local/src/yowsup/nagios.conf -s $_CONTACTWHATSAPP$ "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ ** ***** Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$"
}


templates.cfg

define host{
name test
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 1
check_command check-host-alive
notification_period workhours
notification_interval 120
notification_options d,u,r
contact_groups test
register 0
}



test.cfg


define hostgroup{
hostgroup_name test ; The name of the hostgroup
alias test ; Long name of the group
}


define host {
use test
host_name test
hostgroups test
alias test
address xx.xx.xx.xx
register 1
}

define service{
host_name test
service_description PING
check_command check_ping!150.0,20%!500.0,60%
max_check_attempts 5
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups test
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}



nagios.log

[1471486312] HOST NOTIFICATION: A;test;DOWN;notify-host-by-whatsapp;PING CRITICAL - Packet loss = 100%
[1471486312] HOST NOTIFICATION: B;test;DOWN;notify-host-by-whatsapp;PING CRITICAL - Packet loss = 100%
[1471486312] HOST NOTIFICATION: C;test;DOWN;notify-host-by-whatsapp;PING CRITICAL - Packet loss = 100%
[1471486312] HOST NOTIFICATION: D;test;DOWN;notify-host-by-whatsapp;PING CRITICAL - Packet loss = 100%



Regards,
Kelvin

Last edited by dexfcoss; 08-17-2016 at 10:21 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 08:26 AM
nagios not working (http://localhost/nagios or http://ip/nagios) 404 error connect2janu Linux - Server 1 11-18-2012 03:06 AM
[SOLVED] Problem installing Nconf to use with Nagios - MySQL Problem aocferreira Linux - Server 1 04-06-2011 06:06 AM
LXer: April Nagios Training Dates Include Advanced Nagios Class LXer Syndicated Linux News 0 03-18-2011 10:30 AM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 06:33 PM


All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration