Is there a character limit for the $ARGSn$ ?
Is there a character limit for the $ARGSn$ ?
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?
Re: Is there a character limit for the $ARGSn$ ?
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.
Re: Is there a character limit for the $ARGSn$ ?
Run this command and see if it's cut off in the DB:
- Change TEXT to the service description of the service
- 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 nagiosqlRe: Is there a character limit for the $ARGSn$ ?
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
Re: Is there a character limit for the $ARGSn$ ?
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.
Re: Is there a character limit for the $ARGSn$ ?
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:
Then change your $ARGn$ to:
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.
Edit /usr/local/nagios/etc/resource.cfg and add this to the bottom:
Code: Select all
$USER9$=text/xml; charset=utf-8Code: Select all
-k 'Content-Type: $USER9$'Let us know the results.
Re: Is there a character limit for the $ARGSn$ ?
That config change did the trick. This is now working. Thanks so much for your help on this.
Re: Is there a character limit for the $ARGSn$ ?
That's great to hear, are we okay to mark this as resolved and lock the topic?
Re: Is there a character limit for the $ARGSn$ ?
Yes please resolve this issue. 