System Monitoring OTRS/NAGIOS
-
nathanplatt
- Posts: 267
- Joined: Thu May 07, 2015 4:59 am
Re: System Monitoring OTRS/NAGIOS
Yes, sorry i didn't make that clear. I just saw that set of instructions and through it might make things clearer. Its a shame the author of the bash scripts didn't leave more clear instructions.
-
nathanplatt
- Posts: 267
- Joined: Thu May 07, 2015 4:59 am
Re: System Monitoring OTRS/NAGIOS
Just tested this, and its still not working. Any suggestions of what to try next?
-
nathanplatt
- Posts: 267
- Joined: Thu May 07, 2015 4:59 am
Re: System Monitoring OTRS/NAGIOS
I've modified the .sh files to help me work out where this is failing (attached 1 scripts for review). The tail of the otrs.log is still showing very little;
Have i configured the .sh script incorrectly?
This is the tail of the nagios.log
I saw the script errors and changed the .sh file to one attached, but still all i seem to get is the printf from the start of the script, its as if it never processes the body and goes to the email.
Code: Select all
nagios@nagios:/usr/local/nagios/libexec/eventhandlers$ tail /usr/local/nagios/var/otrs.log
2016-01-25_12:41:06 EVENTHANDLER IT/Toner Supply: State WARNING/HARD/3
2016-01-25_12:42:20 EVENTHANDLER MS2-V/CPU Load: State WARNING/SOFT/1
2016-01-25_12:44:20 EVENTHANDLER MS2-V/CPU Load: State OK/SOFT/2
otrs_event_ok start point2016-01-25_13:21:00 EVENTHANDLER IT/Toner Supply: State OK/HARD/3
otrs_event_ok start point
2016-01-25_13:51:06 EVENTHANDLER IT/Toner Supply: State WARNING/SOFT/1
otrs_event_ok start point
2016-01-25_13:53:06 EVENTHANDLER IT/Toner Supply: State WARNING/SOFT/2
otrs_event_ok start point
2016-01-25_13:55:06 EVENTHANDLER IT/Toner Supply: State WARNING/HARD/3
nagios@nagios:/usr/local/nagios/libexec/eventhandlers$
This is the tail of the nagios.log
Code: Select all
nagios@nagios:/usr/local/nagios/libexec/eventhandlers$ tail /usr/local/nagios/var/nagios.log
[1453730106] SERVICE EVENT HANDLER: IT;Toner Supply;WARNING;HARD;3;otrs-event-ok
[1453730106] wproc: SERVICE EVENTHANDLER job 41 from worker Core Worker 19389 is a non-check helper but exited with return code 2
[1453730106] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;
[1453730106] wproc: stderr line 01: /usr/local/nagios/libexec/eventhandlers/otrs_event_ok.sh: line 52: syntax error near unexpected token `"%s\n"'
[1453730106] wproc: stderr line 02: /usr/local/nagios/libexec/eventhandlers/otrs_event_ok.sh: line 52: `printf "%s\n" "notify_otrs after email" >> $LOGFILE'
[1453730109] HOST ALERT: IT;DOWN;SOFT;7;CRITICAL - Host Unreachable (192.168.1.199)
[1453730172] HOST ALERT: IT;DOWN;SOFT;8;CRITICAL - Host Unreachable (192.168.1.199)
[1453730235] HOST ALERT: IT;DOWN;SOFT;9;CRITICAL - Host Unreachable (192.168.1.199)
[1453730298] HOST ALERT: IT;DOWN;HARD;10;CRITICAL - Host Unreachable (192.168.1.199)
[1453730520] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;IT;1453730519
nagios@nagios:/usr/local/nagios/libexec/eventhandlers$
- Attachments
-
otrs_event_ok.sh- (1.43 KiB) Downloaded 333 times
Re: System Monitoring OTRS/NAGIOS
Can you post the current otrs_event_ok.sh file that you are using, along with a tail relating to the line errors you are seeing in the nagios.log?
Former Nagios Employee
-
nathanplatt
- Posts: 267
- Joined: Thu May 07, 2015 4:59 am
Re: System Monitoring OTRS/NAGIOS
Sorry its taken me so long to come back to you, I've been speaking to a company that will configure this for you and they have told me off the record that you don't need the event handlers for this to work.
Basically you configure OTRS to accept cases from Email, ie [email protected] then configure Nagios to send the alerts their as well.
The issue I have now if configuring OTRS to acknowledge the issue, otherwise as you know it could keep logging cases until someone ack's the problem, and if this happens out of hours, we could come back to 15 cases being logged. Do you have any knowledge about the OTRS side of things?
Basically you configure OTRS to accept cases from Email, ie [email protected] then configure Nagios to send the alerts their as well.
The issue I have now if configuring OTRS to acknowledge the issue, otherwise as you know it could keep logging cases until someone ack's the problem, and if this happens out of hours, we could come back to 15 cases being logged. Do you have any knowledge about the OTRS side of things?
Re: System Monitoring OTRS/NAGIOS
Yes, that basic approach will work. Take a look at the SystemMonitoring extension with OTRS
I also believe that the mentioned scripts we've talked about here, will help to automate things a bit more rather than just an email. This includes the ack and such. I'm not too familiar how it would be handled without external scripting of some sort.
If you'd like us to look into it more specifically for your needs, feel free to email [email protected] for a quote.
I also believe that the mentioned scripts we've talked about here, will help to automate things a bit more rather than just an email. This includes the ack and such. I'm not too familiar how it would be handled without external scripting of some sort.
If you'd like us to look into it more specifically for your needs, feel free to email [email protected] for a quote.
Former Nagios Employee
-
nathanplatt
- Posts: 267
- Joined: Thu May 07, 2015 4:59 am
Re: System Monitoring OTRS/NAGIOS
Thanks for all the help, i'm going to go with the easy way for now. When it become production and I have more time to work on it, i'll come back to the scripts to improve upon it. I'll like the system to log overnight so we can see if things are resolving themselves and what caused them, but for now I've set the OTRS emails only to send during workhours. Please close, and thanks again
Re: System Monitoring OTRS/NAGIOS
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else
Be sure to check out the Knowledgebase for helpful articles and solutions!