NagiosEnterprises / ncpa

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

check disk/logical - Information status - missing information #874

Open likann opened 2 years ago

likann commented 2 years ago

Hey,

When I use the ncpa logical disk check, I have all information (used space, free space and total space) if I check on pourcent via -M 'disk/logical/O:|' -w 90 -c 95 (warning if above 90% and critical if above 95%) My result is: OK: Used disk space was 72.40 % (Used: 1086.07 GiB, Free: 413.88 GiB, Total: 1499.95 GiB) -> Perfect

If I check on free space 'disk/logical/J:|/free' -c 10: -u Gi (critical if below 10GiB) , I have only the free space returned.. (OK: Free was 125.59 GiB ) Whatever information is returned, The idea is having all information.

Can you implement this for the next version? Thank you.

My config:

define command { command_name check_ncpa command_line $USER5$ /usr/local/nagios/libexec/check_ncpa.py -H $HOSTADDRESS$ -t $USER4$ -P 5693 $ARG1$ }

define service { host_name MYSERVER service_description Disk_J check_command check_ncpa!-M 'disk/logical/J:|/free' -c 10: -u Gi use local-service }

OK: Free was 125.59 GiB -> MISSSING USED / FREE / TOTAL information

define service { host_name MYSERVER service_description Disk_O check_command check_ncpa!-M 'disk/logical/O:|' -w 90 -c 95 use local-service }

OK: Used disk space was 72.40 % (Used: 1086.07 GiB, Free: 413.88 GiB, Total: 1499.95 GiB)

MrPippin66 commented 2 years ago

I'm not sure what you're really asking for.

When you specify the "free" branch of the node, that's expressly what it's returning.

If you're wanting all the information, then you shouldn't specify the 'free' node in the specification.

What I gather you want is to specify the disk/logical/, but have the check done against a subnode, which isn't a bad idea.

likann commented 2 years ago

I would like to check my logical disk "J" on "free" space.
Example: Below 10Gb, I would like a critical alert.

That's ok via -M 'disk/logical/J:|/free' -c 10: -u Gi The check is correct.

However, I have not the information about total and used space on "Information status".

LINK

MrPippin66 commented 2 years ago

Which I said, that's reporting exactly as it's supposed to. The "free" node only reports free space.

The indication to me is you want to report the base node (disk/logical/{mount}), but have the check done against the free space.

likann commented 2 years ago

Yes. but I also need to be able to continue checking in percent on the base node. The 2 checks must be possible on the base node? Or.. you modify the stdout on free node to get all information. Now: { "returncode": 0, "stdout": "OK: Free was 379.67 GiB | 'free'=379.67GiB;;;" } corrected? { "returncode": 0, "stdout": "OK: Free was 379.67 GiB (Used: 80.83 GiB, Free: 379.67 GiB, Total: 460.50 GiB) | 'free'=379.67GiB;;;" }

The majority of our checks are on the base node and work with threshold in percent. However, sometimes, we need to check with thresold in free space withtout losing information about used and total space.

In the 2 cases, we need all the reported information (used, free and total).

Sorry for my english.. Thank you for your help :)

MrPippin66 commented 2 years ago

Y, I'd agree being able to specify the subnode for what threshold you want checked in the 'disk/logical' node is desirable, IMO.

A code maintainer will need to review this as a feature request. Hopefully, others will upvote this.