Nagios + Send SMS over gnokii

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
guvijur
Posts: 3
Joined: Wed Oct 02, 2019 8:23 am

Nagios + Send SMS over gnokii

Post by guvijur »

Hi!

There was a problem with sending SMS messages through gnokii.
If I send a test message from the console, then everything is fine.

echo "TEST" | /usr/bin/gnokii --sendsms +79631234567

The message comes and everything is great.

And when I test an emergency, Nagios can't send a message.
That's what I see in the logs:

Oct 9 12:57:10 multitask nagios: wproc: early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
Oct 9 12:57:10 multitask nagios: wproc: stderr line 01: GNOKII Version 0.6.31
Oct 9 12:57:10 multitask nagios: wproc: stderr line 02: LOG: debug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 03: LOG: rlpdebug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 04: LOG: xdebug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 05: Config read from file /etc/gnokiirc.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 06: phone instance config:
Oct 9 12:57:10 multitask nagios: wproc: stderr line 07: model = AT
Oct 9 12:57:10 multitask nagios: wproc: stderr line 08: port = /dev/ttyACM0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 09: connection = serial
Oct 9 12:57:10 multitask nagios: wproc: stderr line 10: initlength = default
Oct 9 12:57:10 multitask nagios: wproc: stderr line 11: serial_baudrate = 19200
Oct 9 12:57:10 multitask nagios: wproc: stderr line 12: serial_write_usleep = -1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 13: handshake = software
Oct 9 12:57:10 multitask nagios: wproc: stderr line 14: require_dcd = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 15: smsc_timeout = 10
Oct 9 12:57:10 multitask nagios: wproc: stderr line 16: rfcomm_channel = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 17: sm_retry = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 18: Initializing AT capable mobile phone ...
Oct 9 12:57:10 multitask nagios: wproc: stderr line 19: Serial device: opening device /dev/ttyACM0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 20: Gnokii serial_open: open: Устройство или ресурс занято
Oct 9 12:57:10 multitask nagios: wproc: stderr line 21: Couldn't open ATBUS device: Устройство или ресурс занято
Oct 9 12:57:10 multitask nagios: wproc: stderr line 22: AT bus initialization failed (1)
Oct 9 12:57:10 multitask nagios: wproc: stderr line 23: Initialization failed (1)
Oct 9 12:57:10 multitask nagios: wproc: stderr line 24: Serial device: closing device
Oct 9 12:57:10 multitask nagios: wproc: stderr line 25: Telephone interface init failed: Command failed.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 26: Quitting.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 27: Command failed.
Oct 9 12:57:10 multitask nagios: wproc: NOTIFY job 6 from worker Core Worker 7801 is a non-check helper but exited with return code 255
Oct 9 12:57:10 multitask nagios: wproc: host=SERVER; service=(none); contact=alex
Oct 9 12:57:10 multitask nagios: wproc: early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
Oct 9 12:57:10 multitask nagios: wproc: stderr line 01: GNOKII Version 0.6.31
Oct 9 12:57:10 multitask nagios: wproc: stderr line 02: LOG: debug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 03: LOG: rlpdebug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 04: LOG: xdebug mask is 0x1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 05: Config read from file /etc/gnokiirc.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 06: phone instance config:
Oct 9 12:57:10 multitask nagios: wproc: stderr line 07: model = AT
Oct 9 12:57:10 multitask nagios: wproc: stderr line 08: port = /dev/ttyACM0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 09: connection = serial
Oct 9 12:57:10 multitask nagios: wproc: stderr line 10: initlength = default
Oct 9 12:57:10 multitask nagios: wproc: stderr line 11: serial_baudrate = 19200
Oct 9 12:57:10 multitask nagios: wproc: stderr line 12: serial_write_usleep = -1
Oct 9 12:57:10 multitask nagios: wproc: stderr line 13: handshake = software
Oct 9 12:57:10 multitask nagios: wproc: stderr line 14: require_dcd = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 15: smsc_timeout = 10
Oct 9 12:57:10 multitask nagios: wproc: stderr line 16: rfcomm_channel = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 17: sm_retry = 0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 18: Initializing AT capable mobile phone ...
Oct 9 12:57:10 multitask nagios: wproc: stderr line 19: Serial device: opening device /dev/ttyACM0
Oct 9 12:57:10 multitask nagios: wproc: stderr line 20: Gnokii serial_open: open: Устройство или ресурс занято
Oct 9 12:57:10 multitask nagios: wproc: stderr line 21: Couldn't open ATBUS device: Устройство или ресурс занято
Oct 9 12:57:10 multitask nagios: wproc: stderr line 22: AT bus initialization failed (1)
Oct 9 12:57:10 multitask nagios: wproc: stderr line 23: Initialization failed (1)
Oct 9 12:57:10 multitask nagios: wproc: stderr line 24: Serial device: closing device
Oct 9 12:57:10 multitask nagios: wproc: stderr line 25: Telephone interface init failed: Command failed.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 26: Quitting.
Oct 9 12:57:10 multitask nagios: wproc: stderr line 27: Command failed.


Perhaps you have already had similar questions, but I did not find. If you know how to solve this problem, then help me.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios + Send SMS over gnokii

Post by benjaminsmith »

Hello @guvijur,
Oct 9 12:57:10 multitask nagios: wproc: stderr line 21: Couldn't open ATBUS device
This maybe a permissions issue. When you send the test message, are logged in as root user or nagios? Try sending the test message as nagios user and see if you get an error or not.

If that's not the case, have you checked the gnokii configuration to make sure you have the correct settings/paths.
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!
Locked