Nagios + Gnokii -> SMS not being sent
adigei
adi at nextlan.ro
Tue Nov 18 00:04:19 CET 2008
Ludo Bosmans (skynet <ludo_bosmans <at> skynet.be> writes:
>
> Hello,
>
> Have you tried to use your "gnokii" command as the "nagios" user?
> Does the nagios user have enough rights to access the serial port that is
> configured with gnokii?
>
> King regards,
>
> Ludo
Thank you all,
i did "su nagios", ran the script and the errors popped out:
~# su nagios
$ /usr/bin/sms_gnokii
GNOKII Version 0.6.27
Couldn't read /home/nagios/.gnokiirc config file.
Couldn't read /home/nagios/.gnokiirc config file.
Couldn't read /etc/gnokiirc config file.
Couldn't read /etc/gnokiirc config file.
Config file cannot be read.
I copied .gnokiirc from /root to /home/nagios and did chown nagios:nagios on it.
Further, gnokii tries to send the message but it ends in another permission
related error:
Connecting
Serial device: opening device USB
Ignoring extra header, type 171, length 5
Found FBUS interface
Can't set configuration: -1
Can't claim control interface: -1
Couldn't open PHONET device: Operation not permitted
Error in link initialisation: 1
Telephone interface init failed: Command failed.
Quitting.
Command failed.
Furthermore, i tried the following:
chown -R nagios:nagios /dev/bus/usb/*
chown -R nagios:nagios /dev/ttyACM0
and
chmod 750 -R /dev/bus/usb/*
chmod 750 /dev/ttyACM0
And now it works! :)
Thanx a lot for your help!
Adi.
> -----Oorspronkelijk bericht-----
> Van: Hugo van der Kooij [mailto:hvdkooij <at> vanderkooij.org]
> Verzonden: zaterdag 15 november 2008 20:35
> Aan: Nagios Users Mailinglist
> Onderwerp: Re: [Nagios-users] Nagios + Gnokii -> SMS not being sent
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> adigei wrote:
> > i spent a week debugging this and ... i still can't see the light from the
> end
> > of the tunnel :), so i'm posting here, hoping someone can see what i'm
> doing
> > wrong.
>
> What nagios version?
>
> > Nagios works perfect at sending e-mail alerts, Gnokii also works perfect
> when i
> > type the commands in the console.
> >
> > So, i added in the file /usr/local/nagios/etc/objects/contacts.cfg
> > for the contact 'admin':
> >
> > service_notification_commands
> notify-service-by-email,notify-service-by-sms
> > host_notification_commands notify-host-by-email,notify-host-by-sms
>
> Right. Just for fun. What happens if you switch the order? SMS first.
> Then email.
>
> > #!/bin/sh
> > #
> > # Gnokii Plugin script
> > # (c) Horst venzke
> > # v 0.1 - 17.01.2004
> >
> > echo Alert |/usr/local/bin/gnokii --sendsms 07xxxxxxxx
>
> Add a line to log to a file and see if that works by checking the log.
>
> Hugo.
>
> - --
> hvdkooij <at> vanderkooij.org http://hugo.vanderkooij.org/
> PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
>
> A: Yes.
> >Q: Are you sure?
> >>A: Because it reverses the logical flow of conversation.
> >>>Q: Why is top posting frowned upon?
>
> Bored? Click on http://spamornot.org/ and rate those images.
>
> Nid wyf yn y swyddfa ar hyn o bryd. Anfonwch unrhyw waith i'w gyfieithu.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iD8DBQFJHyRTBvzDRVjxmYERAvuaAJwJ9bFRhgRqzTKAoxljiPSHZdCerQCeKJ2N
> u98muNPF4uX+TCoz/9bG4+M=
> =NVyY
> -----END PGP SIGNATURE-----
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users <at> 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
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users <at> 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
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at 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
More information about the Users
mailing list