Page 2 of 5
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Wed Nov 04, 2020 9:06 am
by tony
These setting were already set in the NSClient configuration file and the command are still returning - Failed to validate filter see log for details
When we run them from CCM with the Run Check command
In live:
We are running Nagios version 5.6.14
And the NSClinet is version 0.4.4.23
In DEV:
We are running Nagios version 5.7.4
And the NSClinet is version 0.4.4.23
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Wed Nov 04, 2020 6:01 pm
by benjaminsmith
Hi,
So after testing out the same command on a 5.7.4 system, I am getting the same error message. I believe the following section is where it's failing and normally wrapping the arguments in a single quote helps. However, I'm unable to pass 'filter=core = "total"' without an error.
This looks like an issue with handling multiple quotation marks in a string. I'll make a note of this in the bug report.
Benjamin
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Thu Nov 05, 2020 3:05 am
by tony
The issue is more than that.
If you remove the filter argument from the command, it still will not run and returns Failed to validate filter.
$ARG1$ - check_cpu
$ARF2$ - -a "warning=load>=95%" "critical=load>=98%" "time=1m" "time=5m" "time=15m" "top-syntax=%(status): %(list)" "detail-syntax=%(time) load %(load)%"
Output
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 30 -c check_cpu -a "warning=load>=95%" "critical=load>=98%" "time=1m" "time=5m" "time=15m" "top-syntax=%(status): %(list)" "detail-syntax=%(time) load %(load)%"
Failed to validate filter see log for details
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Thu Nov 05, 2020 4:39 pm
by benjaminsmith
Hi,
Interesting. That version does work on my test system. Using Nagios XI 5.7.4 and the same version of NSClient.
run-check-command.png
Please post a screenshot of the Common Settings for the service.
Thanks,
Benjamin
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Fri Nov 06, 2020 3:17 pm
by tony
You have left out the -a in $ARG2$
My command is as follows:
Check Command - check_nrpe
$USER$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
$ARG1$ is check_cpu
$ARG2$ is -a "warning=load>=95%" "critical=load>=98%" "time=1m" "time=5m" "time=15m" "filter=core = 'total'" "top-syntax=%(status): %(list)" "detail-syntax=%(time) load %(load)%"
If you leave out the -a it will run in Core Configuration Manager and display the CPU load for the 3 time periods.
However if you then look at the output of the command in the Nagios XI GUI it only displays - OK: CPU load is ok.
It should instead display the load for the three time ranges - OK: 1m load 1%, 5m load 1%, 15m load 1%
Which it does with the correct syntax including the -a
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Fri Nov 06, 2020 3:32 pm
by tony
Here is a link showing how the syntax of the NSClient and the -a switch
https://docs.nsclient.org/howto/nrpe/
/check_nrpe -H <nsclient++ server ip> -c <command> [-a <a> <list> <of> <arguments>]
command = The command (script) you want to run (often this is a pre-built command from within NSClient++)
a list of arguments = a list of arguments for the command.
the first word is the command and the rest are arguments. check_nrpe has two options for settings commands (-c) and arguments (-a)
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Mon Nov 09, 2020 2:44 pm
by benjaminsmith
Hi Tony,
I have may miss the -a when cutting and pasting from the thread to my system, but I'm getting the same results- failing in the CCM.
run-check-command-2.png
nsclient-test.png
I have added this to our internal bug tracker and we're planning to make some improvements to handle this type of case in the CCM.
Benjamin
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Tue Nov 10, 2020 3:05 am
by tony
Thanks Benjamin back to the check_nrpe version 2 type packets question:
It looks as if we cannot use the Bulk Modification Tool (Change Command and Arguments) to make the mass changes and replace the default check_nrpe command with a new check_nrpe_v2 command, which will have the -2 switch for version 2 type packets.
The Bulk Modification Tool in Nagios XI 5.6.14 is version 2.2.0 and if you change the check command it also changes the arguments. Even if you leave the argument empty it will change them to empty. So this version of the tool changes commands and arguments, it does not give you the ability to only change the check command.
However, the Bulk Modification Tool in Nagios XI 5.7.4 is version 2.3.0. This version of the tool allows you to only change the check command and leave the arguments unchanged. The new version states - “Only argument fields which are checked will be overwritten/updated”.
Is there a way of installing the Bulk Modification Tool version 2.3.0 in Nagios XI 5.6.14 so that we can change all of these commands to version 2 packets before the upgrade?
When making mass changes are there any limitations on the system – do we need to optimize PHP
https://support.nagios.com/kb/article/n ... e-611.html
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Tue Nov 10, 2020 6:40 pm
by benjaminsmith
Hi Tony,
Is there a way of installing the Bulk Modification Tool version 2.3.0 in Nagios XI 5.6.14 so that we can change all of these commands to version 2 packets before the upgrade?
Since this is only available in the enterprise edition, it's not really set up to be added and removed like the other extensions. I will have to follow up with development on this question.
I highly recommend optimizing the PHP settings. It's not uncommon to hit the limits when running large reports and making large changes ( max input variables).
Benjamin
Re: NRPE 4.0.3 and the NSClient - CHECK_NRPE: Invalid packet
Posted: Wed Nov 11, 2020 4:52 am
by tony
Yes could you check with Development as i can not see another way of easily changing just the check command in bulk for services that use the check_nrpe command.