Is there a character limit for the $ARGSn$ ?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mcwhorts
Posts: 60
Joined: Fri Oct 07, 2011 11:59 am

Is there a character limit for the $ARGSn$ ?

Post by mcwhorts »

I'm trying to configure a service that uses check_http to do a POST with some fairly large args. When I run the check manually it works great but when I test it from Configuration Manager it doesn't work. The output I'm seeing from the test I run in Configuration Manager suggests that the args I'm using are being cut off possibly. I'm just wondering if there is a limit to the size of these $ARGn$ and what that limit is. Also are there any work-arounds for this that are standard?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Is there a character limit for the $ARGSn$ ?

Post by ssax »

The DB column is a TEXT type so it's 65,535 (216−1) bytes = 64 KiB, you could be hitting that if you have enough text in there.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Is there a character limit for the $ARGSn$ ?

Post by ssax »

Run this command and see if it's cut off in the DB:
- Change TEXT to the service description of the service

Code: Select all

echo "select * from tbl_service where service_description like '%TEXT%' \G;" | mysql -uroot -pnagiosxi nagiosql
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Is there a character limit for the $ARGSn$ ?

Post by tmcdonald »

It is also important to note that testing from the CCM via the Test Check Command button is not going to be as accurate as running the check naturally by saving it and letting Nagios schedule it. This is due to the check being run as apache in the CCM, and escaping/length issues with PHP and the underlying code.
Former Nagios employee
mcwhorts
Posts: 60
Joined: Fri Oct 07, 2011 11:59 am

Re: Is there a character limit for the $ARGSn$ ?

Post by mcwhorts »

So digging into this issue some more, it looks like there is some issues with the some of the arguments that I'm passing. I added the "-v" for verbose and I'm seeing that some of the arguments are being modified. One of the args I'm passing looks like this -k 'Content-Type: text/xml; charset=utf-8' but from the verbose output it looks like this Content-Type: text/xml\; charset=utf-8 do I need to escape the semicolon? What am I missing? Running the same check from the command line doesn't have this issue.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Is there a character limit for the $ARGSn$ ?

Post by ssax »

I had this exact issue with another customer and I had to use a $USERn$ macro to make it work.

Edit /usr/local/nagios/etc/resource.cfg and add this to the bottom:

Code: Select all

$USER9$=text/xml; charset=utf-8
Then change your $ARGn$ to:

Code: Select all

-k 'Content-Type: $USER9$'
Now apply config and see if it works, you won't be able to use the test check button with $USERn$ macros though, just keep that in mind.


Let us know the results.
mcwhorts
Posts: 60
Joined: Fri Oct 07, 2011 11:59 am

Re: Is there a character limit for the $ARGSn$ ?

Post by mcwhorts »

That config change did the trick. This is now working. Thanks so much for your help on this.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Is there a character limit for the $ARGSn$ ?

Post by ssax »

That's great to hear, are we okay to mark this as resolved and lock the topic?
mcwhorts
Posts: 60
Joined: Fri Oct 07, 2011 11:59 am

Re: Is there a character limit for the $ARGSn$ ?

Post by mcwhorts »

Yes please resolve this issue. ;)
Locked