Bonjour à tous
Je suis sous ubunty edgy, et je voudrais que nagios m'envoi certaines alertes
par sms, j'ai installé gnokii pour l'envoi sms et ça marche très bien avec la
commande
echo "message" | gnokii --sendsms +21697849873 -r
que je sois en root ou avec un utilisateur normal ça marche et je reçois le
message. Par contre quand j'ai configuré nagios pour qu'il fasse la même chose
en créant une commande dans le fichier /etc/nagios2/misccommands.cfg la
commande étant définie de la manière suivante
# notify-bby-sms command definition
define command{
command_name notify-by-sms
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost:
$HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo:
$SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /usr/local/bin/gnokii --sendsms
$CONTACTPAGER$ -r
}
j'ai rajouté notify-by-sms au niveau des notifications du contact root
define contact{
contact_name root
alias Root
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email,notify-by-sms
host_notification_commands host-notify-by-email
email [EMAIL PROTECTED]
pager +2163732948
}
voici le résultat de mes logs lors de l'envoi de l'alerte
[1173884054] Finished daemonizing... (New PID=23180)
[1173884274] SERVICE ALERT: localhost;SSH;OK;HARD;4;SSH OK - OpenSSH_4.3p2
Debian-5ubuntu1 (protocole 2.0)
[1173884274] SERVICE NOTIFICATION: root;localhost;SSH;OK;notify-by-sms;SSH OK -
OpenSSH_4.3p2 Debian-5ubuntu1 (protocole 2.0)
[1173884274] SERVICE NOTIFICATION: root;localhost;SSH;OK;notify-by-email;SSH OK
- OpenSSH_4.3p2 Debian-5ubuntu1 (protocole 2.0)
[1173884574] SERVICE ALERT: localhost;SSH;CRITICAL;SOFT;1;Connexion refusée
[1173884634] SERVICE ALERT: localhost;SSH;CRITICAL;SOFT;2;Connexion refusée
[1173884694] SERVICE ALERT: localhost;SSH;CRITICAL;SOFT;3;Connexion refusée
[1173884754] SERVICE ALERT: localhost;SSH;CRITICAL;HARD;4;Connexion refusée
[1173884754] SERVICE NOTIFICATION:
root;localhost;SSH;CRITICAL;notify-by-sms;Connexion refusée
[1173884754] SERVICE NOTIFICATION:
root;localhost;SSH;CRITICAL;notify-by-email;Connexion refuse
ce qui prouve que le sms et le mail ont bien été envoyé, pourtant je ne reçois
rien quelqu'un a t'il une idée d'où peut provenir le problème ?
meric beaucoup
PS : j'ai installé gnokii 0.6.9 depuis les sources et non pas les paquets Ubuntu
encore merci
--
ubuntu-fr mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-fr