Ciao a tutti..
ho un problema con uno scipt bash elementare (non per me )
Uso nagios per monitoring apparati e servizi di rete..
e uso gli sms di un sito per farmi spedire gli alert..
lo scrpt è questo
#!/bin/bash
CONTACTPAGER=$1
DATETIME=$2
NOTIFICATIONTYPE=$3
SERVICEDESC=$4
HOSTALIAS=$5
HOSTADDRESS=$6
HOSTSTATE=$7
TEXT=`echo -n Data: $DATETIME Notification: $NOTIFICATIONTYPE Servizio: $SERVICEDESC Host: $HOSTALIAS Address: $HOSTADDRESS Status: $HOSTSTATE | /usr/bin/urlencode`
poi questo lo passo a wget:
wget http://xxx.xxx.xxx.xxx/cgi?sms_cont=xxx&sms_text=$TEXT
l'sms arriva a destinazione correttamente il problema è che arriva sfasato..
in partica mi arriva
Data: 27 Notification: 12 Servizio 2005
Host: 15:48:00 Address: ........
la data viene "divisa" infatti ricomponendo ho 27 12 2005 15:48:00
Non capisco come fare per correggere questo errore e far venire
Data: 27 12 2005 15:48:00 Notification: Problem ecc...
Grazie mille