Check Drive Size

Change the field type of the nrpe_arguments field to “Array” in the Director and then put the two arguments into separate entries of that array. Quotes will not be needed, as the Director encases all attributes with quotes automatically.

Example from one of my disk checks:
image

apply Service "disk-h" {
    check_command = "nrpe"
    max_check_attempts = "5"
    check_interval = 5m
    retry_interval = 1m
   ...
    assign where host.name == "xyz"
    vars.graphite_check_command = "disk-windows"
    vars.nrpe_arguments = [ "H:", "98", "99" ]
    vars.nrpe_command = "alias_disk_ex"
    vars.nrpe_timeout = "10"
    vars.nrpe_timeout_unknown = true

    import DirectorOverrideTemplate
}

Check command inside the nsclient.ini looks like this:

alias_disk_ex = check_drivesize "detail-syntax=${drive_or_name} TOTAL: ${size}  USED: ${used} (${used_pct}%) FREE: ${free} (${free_pct}%)" "drive=$ARG1$" "warn=used>$ARG2$%" "crit=used>$ARG3$%"
1 Like