Page 4 of 4
Re: System Monitoring OTRS/NAGIOS
Posted: Fri Jan 22, 2016 4:02 pm
by nathanplatt
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.
Re: System Monitoring OTRS/NAGIOS
Posted: Sat Jan 23, 2016 7:09 am
by nathanplatt
Just tested this, and its still not working. Any suggestions of what to try next?
Re: System Monitoring OTRS/NAGIOS
Posted: Mon Jan 25, 2016 9:06 am
by nathanplatt
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;
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$
Have i configured the .sh script incorrectly?
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$
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.
Re: System Monitoring OTRS/NAGIOS
Posted: Mon Jan 25, 2016 5:09 pm
by rkennedy
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?
Re: System Monitoring OTRS/NAGIOS
Posted: Mon Feb 01, 2016 3:40 am
by nathanplatt
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?
Re: System Monitoring OTRS/NAGIOS
Posted: Mon Feb 01, 2016 11:29 am
by rkennedy
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.
Re: System Monitoring OTRS/NAGIOS
Posted: Mon Feb 01, 2016 11:41 am
by nathanplatt
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
Posted: Mon Feb 01, 2016 12:05 pm
by bwallace
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