Check_http problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Check_http problem

Post by jenstar13 »

Hi, this is a strange one for me
I am moving checks from Core to XI and usually have no problems at all with check_http
This time, the check is expecting the page to be above a certain size
it works fine by command line, and on the server I'm checking by command line

[nagios@prdnagxi01 ~]$ /usr/local/nagios/libexec/check_http -I 10.48.XXX.116 -p 51080 -u "/solr/XXXX_de_DE/select?q=*:*&rows=10&wt=json&indent=true" -m3000
HTTP OK: HTTP/1.1 200 OK - 13916 bytes in 0.034 second response time |time=0.034464s;;;0.000000 size=13916B;3000;0;0

But when I activate the check it returns a warning
HTTP WARNING: HTTP/1.1 200 OK - page size 358 too small - 358 bytes in 0.002 second response time

If I use verbose , the command line returns the whole page, but the GUI cuts it off
is there something in the GUI that truncates output?

I had to randomize some info, but it's checking the output of an apache SOLR server
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_http problem

Post by scottwilkerson »

Can you share you actual check_command line from the service configuration (you can modify the host/URL for privacy)

Basically I'm just trying to make sure that Nagios is going to be executing the exact command you have above.

Can you also paste in the command definition for the command you are using (it will be displayed on the Configure -> CCM -> Services -> Edit page).

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Check_http problem

Post by jenstar13 »

Sure
the command line was above

/usr/local/nagios/libexec/check_http -I 10.48.XXX.116 -p 51080 -u "/solr/XXXX_de_DE/select?q=*:*&rows=10&wt=json&indent=true" -m3000

and the definition is
check_http $USER1$/check_http -I $HOSTADDRESS$ $ARG1$

it's just the basic check http request
and I pulled it from the config file if you needed that

define service {
host_name Hostnames here removed
service_description Alert 185 - V9-Solr-Query - XXXX_de_DE
use generic-service
check_command check_http!-t 30 -p 51080 -u "/solr/$ARG2$/select?q=*:*&rows=10&wt=json&indent=true" -m 3000!XXXX_de_DE!!!!!!
check_interval 10
retry_interval 5
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
event_handler notify-service-by-email
event_handler_enabled 1
process_perf_data 1
retain_status_information 1
notification_interval 10
notification_period 24x7
notification_options w,c,u,r,
notifications_enabled 1
contact_groups admins
notes use dropdown on the action url to change to your store
notes_url http://luence.g.net/display/SA/Nagios+v9+solr+alerts
action_url http://$HOSTADDRESS$:51080/solr
register 1
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_http problem

Post by scottwilkerson »

jenstar13 wrote:and the definition is
check_http $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
Here is the problem
jenstar13 wrote:check_command check_http!-t 30 -p 51080 -u "/solr/$ARG2$/select?q=*:*&rows=10&wt=json&indent=true" -m 3000!XXXX_de_DE!!!!!!
You cannot pass $ARG2$ as a value of $ARG1$ you should change to something like this

Code: Select all

check_command check_http!-t 30 -p 51080 -u "/solr/XXXX_de_DE/select?q=*:*&rows=10&wt=json&indent=true" -m 3000!!!!!!!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Check_http problem

Post by jenstar13 »

ok, thank you, it had worked in core but now that I know this, I created a new command for these checks that cheats a little :-)

ARG2 is the only variable that changes so I made a check_http_special

$USER1$/check_http -I $HOSTADDRESS$ $ARG1$$ARG2$$ARG3$
and split the url up so I could leave ARG2 by itself and change it (we have multiple servers and instances to check )

Thank you for your help!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_http problem

Post by scottwilkerson »

I was going to suggest this but then wasn't sure how much they change..

Glad it is working!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked