Page 1 of 2

SMStools

Posted: Sun Sep 15, 2019 3:55 am
by fsodah
Need help to integrate smstools inside my nagios, please list the steps of installation and integration.

Re: SMStools

Posted: Mon Sep 16, 2019 10:17 am
by mbellerue
We'll need some more information. Are you using a plugin with SMSTools, or are you just trying to use bare SMSTools? What has been done so far to get SMSTools working, and where is it stuck?

Re: SMStools

Posted: Tue Sep 17, 2019 12:13 am
by fsodah
I was able to install it smstools-3.1.15-12.el7.x86_64 on CentOS Linux release 7.6.1810 (Core), I am able to sendsms from root user but as nagios user i keep getting permission error.

Code: Select all

[root@nagios ~]# rpm -aq | grep sms
smstools-3.1.15-12.el7.x86_64
[root@nagios ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 

Code: Select all

2019-09-14 11:54:44,2, smsd: Smsd v3.1.15 started.
2019-09-14 11:54:44,2, smsd: Running as smstools:smstools.
2019-09-14 11:54:44,7, smsd: Running startup_check (shell): /var/spool/sms/incoming/smsd_script.ikTSU1 /tmp/smsd_data.HmeXp2
2019-09-14 11:54:44,7, smsd: Done: startup_check (shell), execution time 0 sec., status: 0 (0)
2019-09-14 11:54:44,4, smsd: File mode creation mask: 022 (0644, rw-r--r--).
2019-09-14 11:54:44,5, smsd: Outgoing file checker has started. PID: 11860.
2019-09-14 11:54:44,7, smsd: All PID's: 11860,11861
2019-09-14 11:54:44,5, GSM1: Modem handler 0 has started. PID: 11861.
2019-09-14 11:54:44,3, GSM1: Couldn't open serial port ttyUSB0, error: No such file or directory, waiting 30 sec.
2019-09-14 11:54:54,3, smsd: Cannot handle /var/spool/sms/outgoing/send_458ujs: Access denied. Check the file and directory permissions.
2019-09-14 11:55:14,3, GSM1: Cannot open serial port ttyUSB0, error: No such file or directory
2019-09-14 11:55:14,2, GSM1: Modem handler 0 terminated. PID: 11861, was started 19-09-14 11:54:44.
2019-09-14 11:58:11,2, smsd: Smsd mainprocess is awaiting the termination of all modem handlers. PID: 11860.
2019-09-14 11:58:11,2, smsd: Smsd mainprocess terminated. PID 11860, was started 19-09-14 11:54:44.
2019-09-14 11:58:12,2, smsd: Smsd v3.1.15 started.
2019-09-14 11:58:12,2, smsd: Running as smstools:smstools.
2019-09-14 11:58:12,7, smsd: Running startup_check (shell): /var/spool/sms/incoming/smsd_script.UPdaLc /tmp/smsd_data.qRW060
2019-09-14 11:58:12,7, smsd: Done: startup_check (shell), execution time 0 sec., status: 0 (0)
2019-09-14 11:58:12,4, smsd: File mode creation mask: 022 (0644, rw-r--r--).
2019-09-14 11:58:12,5, smsd: Outgoing file checker has started. PID: 20456.
2019-09-14 11:58:12,5, GSM1: Modem handler 0 has started. PID: 20457.
2019-09-14 11:58:12,7, smsd: All PID's: 20456,20457
2019-09-14 11:58:12,3, GSM1: Couldn't open serial port ttyUSB0, error: No such file or directory, waiting 30 sec.
2019-09-14 11:58:12,3, smsd: Cannot handle /var/spool/sms/outgoing/send_458ujs: Access denied. Check the file and directory permissions.
2019-09-14 11:58:32,3, smsd: Cannot handle /var/spool/sms/outgoing/send_jRRiZY: Access denied. Check the file and directory permissions.
2019-09-14 11:58:42,3, GSM1: Cannot open serial port ttyUSB0, error: No such file or directory
2019-09-14 11:58:42,2, GSM1: Modem handler 0 terminated. PID: 20457, was started 19-09-14 11:58:12.
2019-09-14 12:01:02,3, smsd: Cannot handle /var/spool/sms/outgoing/send_cTscto: Access denied. Check the file and directory permissions.
2019-09-14 12:02:52,3, smsd: Cannot handle /var/spool/sms/outgoing/send_Y1DxSh: Access denied. Check the file and directory permissions.
2019-09-14 12:04:12,2, smsd: Stopping. Cannot open dir /var/spool/sms/outgoing Permission denied
2019-09-14 12:04:12,2, smsd: Smsd mainprocess terminated abnormally. PID: 20456.
2019-09-14 12:05:45,2, smsd: Smsd v3.1.15 started.
2019-09-14 12:05:45,2, smsd: Running as smstools:smstools.
2019-09-14 12:05:45,7, smsd: Running startup_check (shell): /var/spool/sms/incoming/smsd_script.OhErRI /tmp/smsd_data.snTNnY

Code: Select all

[root@nagios smsd]# ll
total 2212
-rw-r-----. 1 smstools smstools 2230997 Sep 16 16:50 smsd.log
drwxr-x---. 2 smstools smstools      43 Sep 16 16:50 smsd_stats
-rw-r-----. 1 smstools smstools   30741 Sep 16 16:50 smsd_trouble.log
[root@nagios smsd]# 

Code: Select all

[root@nagios smsd]# ll /var/spool/sms/
total 0
drwxr-x---. 2 smstools smstools  6 Sep 16 16:50 checked
drwxr-x---. 2 smstools smstools  6 Sep 16 16:50 failed
drwxr-x---. 2 smstools smstools 25 Sep 16 16:50 incoming
drwxrwx---. 2 smstools nagios    6 Sep 16 16:50 outgoing
drwxr-x---. 2 smstools smstools 44 Sep 16 16:50 sent
[root@nagios smsd]# 

Re: SMStools

Posted: Tue Sep 17, 2019 12:46 am
by fsodah
1.jpg
2.jpg
3.jpg
From nagios out I am not able to send SMS

Re: SMStools

Posted: Tue Sep 17, 2019 10:33 am
by mbellerue
Let's add nagios to the smstools group

Code: Select all

useradd -G smstools nagios
Make the files in /var/spool/sms/ writeable by group

Code: Select all

chmod g+w /var/spool/sms/*
And change the outgoing file back to being owned by smstools:smstools

Code: Select all

chown smstools:smstools /var/spool/sms/outgoing
You may need to restart the Nagios service as well, just to make sure it picks up the new group membership. Give that a try and let me know how it goes.

Re: SMStools

Posted: Tue Sep 17, 2019 2:34 pm
by fsodah
Check this

Re: SMStools

Posted: Tue Sep 17, 2019 2:44 pm
by fsodah
I think i have an issue with /tmp too

Re: SMStools

Posted: Tue Sep 17, 2019 4:25 pm
by mbellerue
Would it be possible to see a full list of /etc/group? You can pm the file to me, if you're worried about posting it on the forum. The reason is, I'm looking over the errors from your earlier post, and I caught this one.

Code: Select all

2019-09-14 11:54:44,3, GSM1: Couldn't open serial port ttyUSB0, error: No such file or directory, waiting 30 sec.
I'm wondering if there's a group, other than smstools, that might be used to access ttyUSB0. I'm guessing that your SMS device is a USB device, and is showing up as ttyUSB0.

Re: SMStools

Posted: Wed Sep 18, 2019 12:05 am
by fsodah
Really appreciate your support

Re: SMStools

Posted: Wed Sep 18, 2019 12:07 am
by fsodah
The config file of my modem, as i said before with root user i can send sms to my phone