Page 1 of 1

Adding services/plugins to exisitng hosts on Nagios XI

Posted: Wed Feb 05, 2020 7:36 pm
by majoradhd
Hello Everyone,

I'm having trouble integrating nagios/otrs on our system.
We came to the conclusion that we are just going to use the Nagios XI API
to add command services to our OTRS.

Please do not post this link in attempt to help me: https://exchange.nagios.org/directory/P ... pl/details

Appreciate any help.

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Thu Feb 06, 2020 4:07 pm
by majoradhd
To be more detailed my team is trying to monitor open/closed RAW tickets from OTRS in the NAGIOS XI system

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Thu Feb 06, 2020 5:50 pm
by tgriep
When you upload a plugin to the server, it does not create a command, you will have to do that by going to the Core COnfig Manager > Commands menu and create a command.
The simplest thing is to copy an existing command and edit the copy.

Run the plugin with the --help option, and it will show you the options to run it.

Code: Select all

/usr/local/nagios/libexec/check_otrs.pl --help

Code: Select all

/usr/local/nagios/libexec/check_otrs.pl plugin for Nagios check for new or open Tickets in OTRS
Copyright (c) 2008 Michael Glaess
Usage:
   -q (--queue)  Queue: Default: 3 entspricht Servicehotline
   -t (--type)   Type:  Default: 0 entspricht Neue Tickets
   -w (--warn)   Warning-Level, Default: 0
   -c (--crit)   Criticle-Level, Default: 2
   -v            Version
   -h (--help)   Help

Usage: /usr/local/nagios/libexec/check_otrs.pl
       /usr/local/nagios/libexec/check_otrs.pl -w 2 -c 3
       /usr/local/nagios/libexec/check_otrs.pl -t 1 -q 3 -w 2 -c 4
Example command name

Code: Select all

Check OTRS
Example command line

Code: Select all

$USER1$/check_otrs.pl -q $ARG1$ -t $ARG2$ -w $ARG3$ -c $ARG4$
Make it a check command and Activate it

Save it out and Apply the Config and you should have the command available.

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 2:08 pm
by majoradhd
Thank you so much for your help :)

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 2:18 pm
by majoradhd
tgriep wrote:When you upload a plugin to the server, it does not create a command, you will have to do that by going to the Core COnfig Manager > Commands menu and create a command.
The simplest thing is to copy an existing command and edit the copy.

Run the plugin with the --help option, and it will show you the options to run it.

Code: Select all

/usr/local/nagios/libexec/check_otrs.pl --help

Code: Select all

/usr/local/nagios/libexec/check_otrs.pl plugin for Nagios check for new or open Tickets in OTRS
Copyright (c) 2008 Michael Glaess
Usage:
   -q (--queue)  Queue: Default: 3 entspricht Servicehotline
   -t (--type)   Type:  Default: 0 entspricht Neue Tickets
   -w (--warn)   Warning-Level, Default: 0
   -c (--crit)   Criticle-Level, Default: 2
   -v            Version
   -h (--help)   Help

Usage: /usr/local/nagios/libexec/check_otrs.pl
       /usr/local/nagios/libexec/check_otrs.pl -w 2 -c 3
       /usr/local/nagios/libexec/check_otrs.pl -t 1 -q 3 -w 2 -c 4
Example command name

Code: Select all

Check OTRS
Example command line

Code: Select all

$USER1$/check_otrs.pl -q $ARG1$ -t $ARG2$ -w $ARG3$ -c $ARG4$
Make it a check command and Activate it

Save it out and Apply the Config and you should have the command available.
I don't know if that that command-line is just an example but I tried using it and it did not work.
any thoughts?

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 2:32 pm
by tgriep
What is the error that you are receiving?

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 3:17 pm
by majoradhd
I'm having specific problems with check_otrs.php any ideas?

Error_reporting (0) ;
Reporting 0 new/open tickets. This is the problem...

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 4:14 pm
by tgriep
Are all of the arguments correct when you run the command?
Have you verified that the data exists in the MYSQL database?

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Fri Feb 07, 2020 5:08 pm
by majoradhd
I figured it out!
Thank you for all your help :D

Re: Adding services/plugins to exisitng hosts on Nagios XI

Posted: Mon Feb 10, 2020 8:14 am
by scottwilkerson
majoradhd wrote:I figured it out!
Thank you for all your help :D
Great!

Locking thread