NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
177 stars 95 forks source link

Feature Request: Provide ability to supply output format of api functions #967

Open MrPippin66 opened 1 year ago

MrPippin66 commented 1 year ago

A feature in NSClient for Windows sorely lacking in NCPA is the ability to specify the output format of the check results.

For instance, the "used_percent" check generally has a fixed format such as follows:

"OK: Used_percent was 30.90 % | 'used_percent'=30.90%;;;"

For instance, on NSCLIENT, you can define a default OK syntax, default syntax, and detail syntax.

Example for disk size check:

detail-syntax="STORAGE: %(drive_or_name) Used = %(used_pct)% Free = %(total_free) Total = %(size)"

Example output:

STORAGE: E: Used = 91% Free = 328.299GB Total = 3.532TB

That's much more useful than the data currently provided by NCPA.

Key item is the ability to specify any of the relevant values for essentially all a given API's node data for a given element.

So...if I had a the ability to do a group check for disk free and inode free, I could specify a like output format like below:

output-format="STORAGE: $name %Used = $used_percent; Total = $total; %Used I-nodes = $inodes_used_percent; Total I-nodes = $inodes"