Still no success. I did this:
Define a command in check_mk/conf.d/sms.mk, which results in these lines in :~/etc/nagios/conf.d/check_mk_objects.cfg:
# sms service command
define command {
command_name notify-service-sms
command_line /usr/bin/smssend $CONTACTPAGER$ ‘$SERVICEDESC$ auf $HOSTALIAS$ State: $SERVICESTATE$ @$DATETIME$ Info: $OUTPUT$’
}
# sms host command
define command {
command_name notify-host-sms
command_line /usr/bin/smssend $CONTACTPAGER$ ‘$HOSTALIAS$ is $HOSTSTATE$ @$DATETIME$ Info: $OUTPUT$’
I created a sms contact, a contact group, assigned the host to the sms contact group.
I set a CRITICAL to the host via the multisite interface and had a lock in ~/var/log/nagios.log:
[1359382169] SERVICE ALERT: internet_dummy;Internet;CRITICAL;HARD;1;Manually set to Critical by omdadmin
[1359382169] SERVICE NOTIFICATION: fli_sms;internet_dummy;Internet;CRITICAL;notify-service-sms;Manually set to Critical by omdadmin
[1359382169] SERVICE ALERT: internet_dummy;PING;CRITICAL;HARD;1;Manually set to Critical by omdadmin
[1359382169] SERVICE NOTIFICATION: fli_sms;internet_dummy;PING;CRITICAL;notify-service-sms;Manually set to Critical by omdadmin
[1359382194] SERVICE ALERT: internet_dummy;PING;OK;HARD;1;OK - 172.16.1.121: rta 0.027ms, lost 0%
[1359382194] SERVICE NOTIFICATION: fli_sms;internet_dummy;PING;OK;notify-service-sms;OK - 172.16.1.121: rta 0.027ms, lost 0%
[1359382225] SERVICE ALERT: internet_dummy;Internet;OK;HARD;1;OK: The Internet seems to be reachable
[1359382225] SERVICE NOTIFICATION: fli_sms;internet_dummy;Internet;OK;notify-service-sms;OK: The Internet seems to be reachable
So the notifications seem to work, but no SMS is sent (the smsd.log gets no entries).
The OMD site user is able to send sms from CLI using the command: /usr/bin/smssend 4917xxxxxxxxx ‘some text’
Then I must have made a mistake in the command definition, which I’m unable to see/understand.
···
Von: Andreas Döhler [mailto:andreas.doehler@gmail.com]
Gesendet: Mittwoch, 23. Januar 2013 14:24
An: Lienhard, Frank
Betreff: Re: [Check_mk (english)] sms notification
With version 1.2.0p3 it looks like the following way.
Define your own command inside one of you manually generated config files → misccommand.cfg or something else.
Then go to the “Users & Contacts” there you will find in the section “Notifications” of every user the point “Notification Command for Hosts” and the same with Services.
There you have to insert the notification command defined before in the config file.
That’s the easiest way but you have to make two users one for notification with email and one for sms.
br
Andreas
2013/1/23 Lienhard, Frank Frank.Lienhard@neos-it.de
The notify-by-sms command is inserted at the user definition
and that’s it.
Didn’t get this one. Which version of check_mk do you use?
Or is that done directly in contact file wato has generated?
Thanks
Frank
Von: Andreas Döhler [mailto:andreas.doehler@gmail.com]
Gesendet: Mittwoch, 23. Januar 2013 12:05
An: Lienhard, Frank
Cc: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] sms notification
To your second posting - the contact definition can be done completely inside wato.
What i do for SMS notification is - create a contact for SMS put it inside a group and assign the group to the wanted services/hosts.
The notify-by-sms command is inserted at the user definition and that’s it.
Negative point you need two contacts one for normal notification and one for sms.
If you write some notification scripts it is possible to do this all with one contact.
br
Andreas
2013/1/23 Lienhard, Frank Frank.Lienhard@neos-it.de
I just read through the check_mk flexible notification document:
http://mathias-kettner.de/checkmk_flexible_notifications.html
From what I understand is, that I get flexible notification on “per user” basis. But in some cases it would be nicer to have it the other
way round e.g.:
I have some host/service that should notify send the notification ALLWAYS as sms (network down or similar). So the CRIT notification for
that host should pass the way of notification to the user.
That way I would be able to define a usergroup sms, a host tag sms and any host going critical with this tag notifies all users of the group
sms via the pager number of these users. This spares me from editing every users contact for the use of sms.
Von:
checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
Im Auftrag von Lienhard, Frank
Gesendet: Mittwoch, 23. Januar 2013 09:14
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] sms notification
OK my question wasn’t that clear, so I’ll start over ..
I installed the smstools on my server (yum install smstools for a centOS/RedHat system)
This howto (german):
http://www.nagios-wiki.de/nagios/howtos/smstools
descripes how to use it with nagios directly (using some additional perl scripts to avoid mass-sending of sms in case of massive fails.
I my case I’ll use sms only in special cases (internet connection fail/ powerfail). So basicly needed are the command definitons
‘notify-by-sms’ command definition
define command{
command_name notify-by-sms
command_line /usr/bin/smssend $CONTACTEMAIL$ '$SERVICEDESC$ auf $HOSTNAME$ State: $SERVICESTATE$
@$DATETIME$ Info: $OUTPUT$’
}
‘host-notify-by-sms’ command definition
define command{
command_name host-notify-by-sms
command_line /usr/bin/smssend $CONTACTEMAIL$ "Host $HOSTALIAS$ is $HOSTSTATE$ @$DATETIME$ Info:
$OUTPUT$"
}
and the contact:
# sms contact definition
define contact{
contact_name admin_sms
alias Admins SMS
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-sms
host_notification_commands host-notify-by-sms
email 49118999xxx
}
Question is can/should some of these definition be done in WATO, or doI have to do it all with
main.mk “extra_nagios_conf +=” mechanism ?
Von:
checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
Im Auftrag von Lienhard, Frank
Gesendet: Dienstag, 22. Januar 2013 14:40
An: checkmk-en@lists.mathias-kettner.de
Betreff: [Check_mk (english)] sms notification
On my old nagios installation I once configured notification via sms, which was used to notify me if the internet link was down and similar cases in which mail
notification is useless. I did that all directly into nagios and its config files. Now I’d like to integrate this, but using check_mk/wato as much as possible.
I’m not sure if this is doable. Is the “pager” row in the contacts menu of WATO mend for this?
(my main source/starting point is down at the moment:
http://www.monitoring-portal.org)
Frank Lienhard
Neos**IT GmbH
Schachtweg 1
38440 Wolfsburg
Tel.
+49 5361 83494-32
Fax
+49 5361 83494-94
mailto:frank.lienhard@neos-it.de
http://www.neos-it.de/
Handelsregister: Amtsgericht Braunschweig, HRB 203557
Geschäftsführer: Sven Wosny
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en