check_apachectl + general $ARG question

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
lraymond
Posts: 29
Joined: Thu Jul 12, 2012 10:14 am

check_apachectl + general $ARG question

Post by lraymond »

Close to having my apache monitoring in place, just a little unsure if I need a seperate host due to another IP. Basically I am using nrpe on custom ports per host getting a lot of good data, disk, ram, etc. Next is apache. Using the nagios server and the command from the cli things work perfect;

check_apachestatus.pl -H 1.1.1.1 -p 81
OK 0.255079 seconds response time. Idle 6, busy 43, open slots 207 | 'Waiting for Connection'=6 'Starting Up'=0 'Reading Request'=2 'Sending Reply'=3 'Keepalive (read)'=38 'DNS Lookup'=0 'Closing Connection'=0 'Logging'=0 'Gracefully finishing'=0 'Idle cleanup'=0 'Open slot'=207 'Requests/sec'=13.0 'kB per sec'=213.0kB 'kB per Request'=16.4kB

That above -p 81 says use port 81 which goes to server 1. -p 82, server 2, etc. My problem is understanding the $ARG's with nagios. I'm sure it's just a definition, but here is all the parts from the command down;
# check_apachestatus.pl -H [-p ] [-t ] [-w -c ] [-V]
define command{
command_name check_http_stat
command_line $USER1$/check_apachestatus.pl -H $HOSTADDRESS$ $ARG1$
}

define host{
use lbremote
host_name WS1
address 1.1.1.1
_tcport 5671
}

########################
## New Apache Checks ##
########################

define service{
use generic-service,srv-pnp
host_name WS1,WS2
service_description Apache Check
check_command check_http!-S -a nagios:nagios2check
}
define serviceextinfo {
service_description Apache Check
host_name WS1,WS2
use basic
}

define service{
use generic-service,srv-pnp
host_name WS1,WS2
service_description Apache-Load
check_command check_http_stat!-w 30 -c 15
}
define serviceextinfo {
service_description Apache-Load
host_name WS1,WS2
use basic
}


So, the command say's $ARG1$ after the host address. Naturally I don't want it to use the NRPE port, so how and where do I say WS1 = port 81, WS2 = port 82, etc. Naturally got a txt his am with issues, and I have load, RAM, space, etc. but no apache which is what's giving issues, so would love to have that info!

The other issue is using the above I was getting errors with the serviceextinfo saying the basic template could not be found. I guess that's what the developer had, but I tried using my lbremote one as well as generic-serivice which still didn't work so I commented out the extinfo, then it did restart and I changed the command to be;
# check_command check_http!-S -a -p 81 nagios:nagios2check
to give errors on the 2 checks;
critical - (Return code of 126 is out of bounds - plugin may not be executable)

So I am going to continue my reading, thank as always!
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_apachectl + general $ARG question

Post by jsmurphy »

serviceextinfo is actually deprecated, it's a legacy object for compatibility with people upgrading from older versions... the standard service definition object now supports all the arguments that extinfo used to do; so there is no need to use it. For answers to your other question see your other thread.
Locked