SMStools

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

SMStools

Post by fsodah »

Need help to integrate smstools inside my nagios, please list the steps of installation and integration.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SMStools

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post 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]# 
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post by fsodah »

1.jpg
2.jpg
3.jpg
From nagios out I am not able to send SMS
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SMStools

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post by fsodah »

Check this
You do not have the required permissions to view the files attached to this post.
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post by fsodah »

I think i have an issue with /tmp too
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SMStools

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post by fsodah »

Really appreciate your support
You do not have the required permissions to view the files attached to this post.
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: SMStools

Post by fsodah »

The config file of my modem, as i said before with root user i can send sms to my phone
You do not have the required permissions to view the files attached to this post.
Locked