Page 2 of 6
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:14 pm
by A.Cormack
The output from he command wasnt the most helpful. Just says that -c is critical, -w warning etc.
All I want the check to do is produce a certain a warning/critical alarm when the server reaches a certain ammount of requests. So I'm guessing my $ARG1$ would be ( values are for example purpose)
and then my command
Code: Select all
$USER1$/check_apacherequests -H $HOSTADDRESS$ -a $ARG1$
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:18 pm
by abrist
Looks good. Though this plugin is an example of a poorly documented one, but at least it is easy to configure.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:25 pm
by A.Cormack
abrist wrote:Looks good. Though this plugin is an example of a poorly documented one, but at least it is easy to configure.
Yeah I think that's the problem I had, there was no guide so with it being my first time I was a bit clueless.
So I did what I said above and went to apply the configuration but I got an error saying it could not be completed. Below is the snapshot information.
Code: Select all
Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config file '/usr/local/nagios/etc/hosts/VS2.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/VS3.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/Switch.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/VS1.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/localhost.cfg'...
Processing object config directory '/usr/local/nagios/etc/services'...
Processing object config file '/usr/local/nagios/etc/services/VS2.cfg'...
Processing object config file '/usr/local/nagios/etc/services/VS3.cfg'...
Processing object config file '/usr/local/nagios/etc/services/Switch.cfg'...
Processing object config file '/usr/local/nagios/etc/services/check_apacherequests.cfg'...
Processing object config file '/usr/local/nagios/etc/services/VS1.cfg'...
Processing object config file '/usr/local/nagios/etc/services/localhost.cfg'...
Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'Apache Requests' on host 'VS1'
Error: Could not register service (config file '/usr/local/nagios/etc/services/check_apacherequests.cfg', starting on line 14)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
No doubt its related too
Code: Select all
Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'Apache Requests' on host 'VS1'
Error: Could not register service (config file '/usr/local/nagios/etc/services/check_apacherequests.cfg', starting on line 14)
Error processing object config files!
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:39 pm
by lmiltchev
Go to the Core Config Manager->Services->Apache Requests->Modify
Under the "Check Settings" tab, enter the correct values for:
Code: Select all
Check interval
Retry interval
Max check attempts
Under the "Alert Settings" tab, enter the correct value for:
Save and Apply Configuration.
BTW, did you test your check from the command line first, to make sure it works?
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:48 pm
by A.Cormack
lmiltchev wrote:
Under the "Check Settings" tab, enter the correct values
BTW, did you test your check from the command line first, to make sure it works?
That's worked a treat

Configuration now saved. Thank You.
lmiltchev wrote:
BTW, did you test your check from the command line first, to make sure it works?
I didn't, I forgot... sorry. Now im paying the price for it as it says (null) under status information, so I guess i need to change $ARG1$ as the command is incorrect?
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 5:03 pm
by slansing
It may be reporting incorrectly formatted data. This is why I personally check all the plugins I use from the command line before configuring, this will also let you filter out problems with how you have them defined "might be the issue here." I suggest you test it from the command line and let us know what the output is. As it may provide more info than Nagios XI does when it comes to debugging..

Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 5:05 pm
by A.Cormack
Sorry for the slowness with giving you information

Still learning and taking notes as I go through it lol
Code: Select all
[root@localhost libexec]# ./check_apacherequests.pl -w 2 -c 3
sh: /usr/bin/lynx: No such file or directory
Argument "" isn't numeric in numeric ge (>=) at ./check_apacherequests.pl line 76.
OK - current apache requests | 'apache requests'=;2;3
[root@localhost libexec]#
I just read it properly.... its because I havent got lynx
Code: Select all
[root@localhost libexec]# sudo apt-get install lynx
>>> /etc/sudoers: Alias `NAGIOSXI' already defined near line 110 <<<
sudo: parse error in /etc/sudoers near line 110
sudo: no valid sudoers sources found, quitting
You have new mail in /var/spool/mail/root
[root@localhost libexec]# apt-get install lynx
-bash: apt-get: command not found
[root@localhost libexec]#
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 5:11 pm
by lmiltchev
Install lynx first:
Then go to the CCM->Services->Apache Requests->Modify
and enter in the $ARG1$ field your warning and critical flags, for example:
Save and Apply Configuration.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 5:13 pm
by A.Cormack
lmiltchev wrote:Install lynx first:
Then go to the CCM->Services->Apache Requests->Modify
and enter in the $ARG1$ field your warning and critical flags, for example:
Save and Apply Configuration.
yeah sorrym rookie mistake... i tried to edit my post before anyone read it.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 5:13 pm
by slansing
You will need to install it as root as Andy suggested on the last page "just to keep in mind."