Page 1 of 1
error sending through Multitech MTR
Posted: Thu Aug 22, 2019 4:41 pm
by scheived
Anyone know how to get a multitech MTR to work to send out sms messages? The Multitech MTR API integration documentation no longer works. In nagios I just get An error occurred sending the test SMS message.
Nagios XI 5.6.6 with MultiTech MTR Integration component 1.0.2
Re: error sending through Multitech MTR
Posted: Fri Aug 23, 2019 9:30 am
by bheden
When you say the documentation no longer works, do you mean that you can't follow those instructions? If so, I'm curious to know how/why/what changed.
This may seem like a silly question, but have you configured the MultiTech device to enable SMS?
Re: error sending through Multitech MTR
Posted: Fri Aug 23, 2019 10:20 am
by scheived
I was able to follow the directions, enabled sms and created a user for Nagios to use. From the multitech device webpage I am able to sent an sms so I believe cellular sms is working. I'm wondering if there is something else that needs to be done out of the box to get it working, is there a log on Nagios might help? tcpdump doesn't help much since it uses https which is encrypted.
Re: error sending through Multitech MTR
Posted: Fri Aug 23, 2019 11:15 am
by bheden
I wonder if the data being sent is being malformed somehow.
Are you able to share a screenshot of what messages you're trying to send looks like?
Also, in tcpdump - you can see that it's making a connection to the device, correct?
Are there any logs on the multitech to see if it's hitting the proper endpoints?
A log for the mtr callbacks might exist in /usr/local/nagiosxi/var/event_handler.log and/or /usr/local/nagiosxi/var/eventman.log.
Re: error sending through Multitech MTR
Posted: Fri Aug 23, 2019 3:52 pm
by scheived
Well it looks like multitech is too buggy to get working, what solution would one recommend for nagios out-of-band sending of notifications?
Re: error sending through Multitech MTR
Posted: Mon Aug 26, 2019 11:48 am
by cdienger
@bheden and anyone else troubleshooting a MTR, I've found /var/log/api.log on the MTR useful in troubleshooting. A successful test message is logged like:
Code: Select all
2019-08-26T18:11:25.578528+00:00 mtr API: [SESSION] Starting FCGI Request [46812]
2019-08-26T18:11:25.579702+00:00 mtr API: [SESSION] count 48 total 48 v_mStdIn.size 1
2019-08-26T18:11:25.580054+00:00 mtr API: [SESSION] Response Started
2019-08-26T18:11:26.220836+00:00 mtr API: pam_unix(api:session): session opened for user nagiosadmin by (uid=0)
2019-08-26T18:11:26.224692+00:00 mtr API: [SESSION] Authorized Agent [nagiosadmin] Permission [admin] IP [192.168.55.2] Port [34808] Token [53237CA5DC6969039A9ADDC79F985C1]
2019-08-26T18:11:26.225738+00:00 mtr API: [SESSION] Ending FCGI Request [46812] as [RESPONDER]
2019-08-26T18:11:26.229908+00:00 mtr lighttpd[732]: 192.168.55.2 192.168.0.99 - [26/Aug/2019:18:11:25 +0000] "POST /api/login HTTP/1.1" 200 340 "-" "-"
2019-08-26T18:11:26.314844+00:00 mtr API: [SESSION] Starting FCGI Request [46813]
2019-08-26T18:11:26.316138+00:00 mtr API: [SESSION] count 127 total 127 v_mStdIn.size 1
2019-08-26T18:11:26.316500+00:00 mtr API: [SESSION] Response Started
2019-08-26T18:11:26.318714+00:00 mtr API: [SESSION] Authorized Agent [nagiosadmin] Permission [admin] IP [192.168.55.2] Port [34808] Token [53237CA5DC6969039A9ADDC79F985C1]
2019-08-26T18:11:26.319373+00:00 mtr API: [ROUTER][ADD][sms/outbox]
2019-08-26T18:11:26.358696+00:00 mtr API: [SESSION] Ending FCGI Request [46813] as [RESPONDER]
2019-08-26T18:11:26.363615+00:00 mtr lighttpd[732]: 192.168.55.2 192.168.0.99 - [26/Aug/2019:18:11:26 +0000] "POST /api/sms/outbox HTTP/1.1" 200 56 "-" "-"
2019-08-26T18:11:26.480522+00:00 mtr API: [SESSION] Starting FCGI Request [46814]
2019-08-26T18:11:26.491755+00:00 mtr API: [SESSION] Response Started
2019-08-26T18:11:26.494275+00:00 mtr API: [SESSION] Logging out this user [nagiosadmin]!
2019-08-26T18:11:26.498707+00:00 mtr API: pam_unix(api:session): session closed for user nagiosadmin
2019-08-26T18:11:26.510705+00:00 mtr API: [SESSION] Ending FCGI Request [46814] as [RESPONDER]
2019-08-26T18:11:26.514116+00:00 mtr lighttpd[732]: 192.168.55.2 192.168.0.99 - [26/Aug/2019:18:11:26 +0000] "GET /api/logout?token=53237CA5DC6969039A9ADDC79F985C1 HTTP/1.1" 200 340 "-" "-"
I'd start with a quick check on the exchange -
https://exchange.nagios.org/index.php?o ... chword=sms - to find alternatives.
Re: error sending through Multitech MTR
Posted: Mon Aug 26, 2019 2:25 pm
by scheived
Thanks for that! I narrowed it down to authentication error, and it seems the multitech api doesn't always work with special characters in the password.
Now it seems to be working fine.
Re: error sending through Multitech MTR
Posted: Mon Aug 26, 2019 2:43 pm
by mbellerue
Excellent, glad you got it working! Closing thread.