Check_procs via nrpe


I try to monitor different procs on a client via nrpe.


apply Service for (proc => config in host.vars.procs) {
    import "generic-service"
    check_command = "nrpe"    
    vars += config


vars.procs["cba"] = {
        vars.nrpe_command =     "check_procs"
        vars.nrpe_timeout_unknown =     true // -u
        vars.nrpe_no_ssl =              true // -n
        vars.nrpe_arguments =  ???

Is it possible to built a config for the nrpe_arguments like my http checks on the master?:

vars.http["http-mongodb"] = {
        vars.http_port  =   "0000"
        vars.http_uri   =   [ "/abcd" ]

I dont want to create a command for each proc in the nrpe.cfg like this:

command[check-proc-cba]=/usr/lib/nagios/plugins/check_procs -w 2:2 -c 2:2 -a cba

rather a solution for config in my hosttemplate.


one of the reasons why I cannot recommend NRPE - the configuration formats don’t fit and it gets cumbersome. You can of course allow every argument being overridden with nrpe_arguments (the security issue is already opened with allowing -a on the client anyways).

This goes even further, -w and -c can be overridden in the “-a” section … but psssst, don’t tell the security department.

In your example, nrpe_arguments is just an array with key and value parameter pairs.

  vars.nrpe_arguments = [ "procname", "-w", "2:2", "-c", "2:2" ]

Icinga doesn’t validate this, nor checks whether the order is correct. That being said, I wouldn’t put that into production but rather migrate to the Icinga agent. There the thresholds can just be set similar to your http check, with the only difference of setting the command_endpoint attribute to control where the check is executed.



I expect this answer :persevere:, but thanks for your efforts!!! :slight_smile:

1 Like