Providing Two Arguments i.e. Critical and Warning Thresholds in Uptime Service

Hi There,
I am facing an issue and need your help in diagnosing that. Basically I am trying to pass values for warning and critical thresholds in as arguments in check command for uptime service like mentioned below from icingaweb2.

Check Command:
‘/usr/lib64/nagios/plugins/check_nrpe’ ‘-H’ ‘’ ‘-c’ ‘check_uptime’ ‘-p’ ‘5666’ ‘-a’ ‘warn=uptime < 10m’ ‘crit=uptime < 5m’

Indented Output

but icinga is changing my check command as below, adding multiple escape character.

Check Command After Deployment and Applied Changes
‘/usr/lib64/nagios/plugins/check_nrpe’ ‘-H’ ‘’ ‘-c’ ‘check_uptime’ ‘-p’ ‘5666’ ‘-a’ ‘’’‘warn=uptime < 10m’’’ ‘’‘crit=uptime < 5m’’’’

Kindly ignore logical errors and help us with escape characters and how to add two values in the arguments.

Thanks in Advance.

Hello @HamzaArshad!

Please share your config.


@Al2Klimov What type of configurations you want to see?

Check command and host/service.

Please find it in attached screenshot. Service is Check_uptime.

please also share the service configuration not only the checkcommand object.
Did you try to fill the custom-vars fields without any brackets and stuff?
icinga2 automatically adds them, so they might be unnecessary

Yes, I have tried without brackets also but it keeps on adding escape characters which is causing command to not execute perfectly. Can you specify the exact service configuration ? that I need to send.

The same way that you used with the checkCommand :slightly_smiling_face:

Is it feasible for you to organize a 10 to 15-minutes online session?. In which I will show you my work

Have you tried this

@radioactive9 I have tried this and the output is

In case you are using the Director:
Be sure that the datafield type for the nrpe_arguemnts data field is Array. This way you the option to enter arguemnts like @radioactive9 is howing in his screenshot.

If that is done you don’t even need the quotation marks, as the Director will add them automatically.
(exception: single quotes might be needed if adding a filter=... statement to your arguments)

If you are using config files you will have to define the varialbe like this
vars.nrpe_arguments = [ "warning=used > 90%", "critical=used > 95%" ]

It has been implemented and is now functional. Many many thanks to all for support :smiling_face_with_three_hearts: