Unable to send mail via Nagios
Posted: Tue May 30, 2017 3:35 am
Operating system name and version: : Fedora 15
Version of smsd: 3.1.14
Name and model of a modem / phone: Itegno w3800u
Interface: USB
Currently I'm working for sending alert notification (SMS) through Nagios 3.2.3 I have configured Nagios to send SMS using smstools3 but it doesn't send out any SMS.
Below is the config file
i) /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name notify-host-by-sms
command_line /usr/local/bin/sendsms -d $CONTACTPAGER$ "** Nagios ** $NOTIFICATIONTYPE$ $HOSTACKCOMMENT$ $HOSTNAME$ is $HOSTSTATE$ Add: $HOSTADDRESS$ $SHORTDATETIME$"
}
# 'notify-service-by-sms' command definition
define command{
command_name notify-service-by-sms
command_line /usr/local/bin/sendsms -d $CONTACTPAGER$ "** Nagios ** $NOTIFICATIONTYPE$ $SERVICEACKCOMMENT$ Host: $HOSTNAME$ Alert: $SERVICEDESC$ is $SERVICESTATE$ Address: $HOSTADDRESS$ Info: $SERVICEOUTPUT$ $SHORTDATETIME$"
}
ii) /etc/smsd.conf
# Example smsd.conf. Read the manual for a description
devices = GSM1
logfile = /var/log/smsd/smsd.log
loglevel = 7
user = smstools
# 3.1.5 introduced smart logging
# once your configuration is OK, set log level lower (5 is good in most cases)
smart_logging = yes
[GSM1]
device = /dev/ttyUSB1
incoming = yes
#pin = 1111
Belos is folder permission
i) folder permission under /var/spool/sms
drwxr-xr-x 7 smstools smstools 4096 May 17 11:21 .
drwxr-xr-x. 17 root root 4096 May 11 10:12 ..
drwxr-x--- 2 smstools smstools 4096 May 30 13:27 checked
drwxr-x--- 2 smstools smstools 4096 Feb 9 2011 failed
drwxr-x--- 2 smstools smstools 4096 May 30 13:26 incoming
drwxrwxrwx 2 smstools nagios 2019328 May 30 16:29 outgoing
drwxr-x--- 2 smstools smstools 4096 Feb 9 2011 sent
ii) file permission under /var/spool/sms/outgoing
drwxrwxrwx 2 smstools nagios 2019328 May 30 16:31 .
drwxr-xr-x 7 smstools smstools 4096 May 17 11:21 ..
-rw------- 1 nagios nagios 89 May 30 13:39 send_0L3v2r
-rw------- 1 nagios nagios 98 May 30 13:39 send_2USLqL
-rw------- 1 nagios nagios 98 May 30 13:39 send_3M9YXw
-rw------- 1 nagios nagios 89 May 30 13:39 send_4xO19E
-rw------- 1 nagios nagios 98 May 30 13:39 send_cO1dRx
-rw------- 1 nagios nagios 89 May 30 13:39 send_ctLGpi
-rw------- 1 nagios nagios 98 May 30 13:39 send_DO7tHM
-rw------- 1 nagios nagios 89 May 30 13:39 send_gIgqsb
When compiling Nagios using /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg it shows no error. I can send SMS manually using sendsms command.
When nagios trigger notify-host-by-sms, the sms file format will use username (nagios) and group (nagios) to send sms out. But it smstools, it only allow username(smstools) and group(smstools) to send sms out. How to change file /folder permission to deliver sms succesfully in nagios.
Kindly advise.
Version of smsd: 3.1.14
Name and model of a modem / phone: Itegno w3800u
Interface: USB
Currently I'm working for sending alert notification (SMS) through Nagios 3.2.3 I have configured Nagios to send SMS using smstools3 but it doesn't send out any SMS.
Below is the config file
i) /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name notify-host-by-sms
command_line /usr/local/bin/sendsms -d $CONTACTPAGER$ "** Nagios ** $NOTIFICATIONTYPE$ $HOSTACKCOMMENT$ $HOSTNAME$ is $HOSTSTATE$ Add: $HOSTADDRESS$ $SHORTDATETIME$"
}
# 'notify-service-by-sms' command definition
define command{
command_name notify-service-by-sms
command_line /usr/local/bin/sendsms -d $CONTACTPAGER$ "** Nagios ** $NOTIFICATIONTYPE$ $SERVICEACKCOMMENT$ Host: $HOSTNAME$ Alert: $SERVICEDESC$ is $SERVICESTATE$ Address: $HOSTADDRESS$ Info: $SERVICEOUTPUT$ $SHORTDATETIME$"
}
ii) /etc/smsd.conf
# Example smsd.conf. Read the manual for a description
devices = GSM1
logfile = /var/log/smsd/smsd.log
loglevel = 7
user = smstools
# 3.1.5 introduced smart logging
# once your configuration is OK, set log level lower (5 is good in most cases)
smart_logging = yes
[GSM1]
device = /dev/ttyUSB1
incoming = yes
#pin = 1111
Belos is folder permission
i) folder permission under /var/spool/sms
drwxr-xr-x 7 smstools smstools 4096 May 17 11:21 .
drwxr-xr-x. 17 root root 4096 May 11 10:12 ..
drwxr-x--- 2 smstools smstools 4096 May 30 13:27 checked
drwxr-x--- 2 smstools smstools 4096 Feb 9 2011 failed
drwxr-x--- 2 smstools smstools 4096 May 30 13:26 incoming
drwxrwxrwx 2 smstools nagios 2019328 May 30 16:29 outgoing
drwxr-x--- 2 smstools smstools 4096 Feb 9 2011 sent
ii) file permission under /var/spool/sms/outgoing
drwxrwxrwx 2 smstools nagios 2019328 May 30 16:31 .
drwxr-xr-x 7 smstools smstools 4096 May 17 11:21 ..
-rw------- 1 nagios nagios 89 May 30 13:39 send_0L3v2r
-rw------- 1 nagios nagios 98 May 30 13:39 send_2USLqL
-rw------- 1 nagios nagios 98 May 30 13:39 send_3M9YXw
-rw------- 1 nagios nagios 89 May 30 13:39 send_4xO19E
-rw------- 1 nagios nagios 98 May 30 13:39 send_cO1dRx
-rw------- 1 nagios nagios 89 May 30 13:39 send_ctLGpi
-rw------- 1 nagios nagios 98 May 30 13:39 send_DO7tHM
-rw------- 1 nagios nagios 89 May 30 13:39 send_gIgqsb
When compiling Nagios using /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg it shows no error. I can send SMS manually using sendsms command.
When nagios trigger notify-host-by-sms, the sms file format will use username (nagios) and group (nagios) to send sms out. But it smstools, it only allow username(smstools) and group(smstools) to send sms out. How to change file /folder permission to deliver sms succesfully in nagios.
Kindly advise.