process command parameters not working

This forum was archived to /woltlab and is now in read-only mode.
  • i want to setup process service differently .

    i don't want count of all process but only process which are using CPU more then 99 percentage .

    i have configure server following way .

    1. apply Service "procs" {
    2. command_endpoint = host.vars.client_endpoint
    3. check_command = "procs"
    4. vars.procs_pcpu = 99
    5. assign where host.vars.client_endpoint
    6. }

    i can see defined Custom attributes in icinga web

    still it count all running process .

    how to configure process service so it count only process which using more then 99 % CPU ?

  • Welcome to the Forum @ankit360,

    did you have a look to the binary behind the command "procs" ?

    There is a example in the help:

    1. check_procs -w 10 -c 20 --metric=CPU
    2. Alert if CPU of any processes over 10%% or 20%%

    Example output:

    1. CPU OK: 129 processes | procs=129;;;0; procs_warn=0;;;0; procs_crit=0;;;0;

    If you want to configure that in icinga2 you can do it like this:

    1. apply Service "procs" {
    2. command_endpoint = host.vars.client_endpoint
    3. check_command = "procs"
    4. vars.procs_critical = 99
    5. vars.procs_metric = "CPU"
    6. assign where host.vars.client_endpoint
    7. }

  • i tried it but its not working . BTW from where you got attribute ?

    nothing such attribute is mention in icinga official document .…n-check-command-processes

  • Found in /usr/share/icinga2/include/command-plugins.conf

  • Found in /usr/share/icinga2/include/command-plugins.conf

    i even set vars.procs_pcpu = 99 in command-plugins.conf still no luck

  • You shouldn't modify files inside the ITL, that's gonna be overwritten on upgrades. Instead, use the custom attributes on your service from the "procs" CheckCommand. All available options are here:…n-check-command-processes

    In case it does not work, please extract the executed command line and manually verify and test that. Instructions how to fetch such can be found in the troubleshooting docs.…g#checks-executed-command

  • i found that check is executed twice .

    first check executed with command parameters which i specified in service configuration file and other check executed without command parameters .

    any idea why it check it twice ?

    below is debug.log