Check_drivesize - detail-syntax not working


#1

Hi,

Anything I enter for detailed syntax seem to give the same default output. Am I doing something wrong here? Top-Syntax seems to work with some variables and ok-syntax works but detailed doesn’t seem to do anything.

Tried 0.4.3.143 and 0.5.0.62.

Default output:

/usr/local/nagios/libexec/check_nrpe -H terminator -c check_drivesize -a drive=* “filter=size>1G” “warn=free<20G” "crit=free<10G" OK All 1 drive(s) are ok|‘C:\ free’=22.79899GB;20;10;0;49.89941 ‘C:\ free %’=46%;40;20;0;100

Detail syntax modification:

/usr/local/nagios/libexec/check_nrpe -H terminator -c check_drivesize -a drive=* “filter=size>1G” “warn=free<20G” “crit=free<10G” "detail-syntax=%(drive)" OK All 1 drive(s) are ok|‘C:\ free’=22.79899GB;20;10;0;49.89941 ‘C:\ free %’=46%;40;20;0;100

/usr/local/nagios/libexec/check_nrpe -H terminator -c check_drivesize -a drive=* “filter=size>1G” “warn=free<20G” “crit=free<10G” "detail-syntax=%(drive_or_id)" OK All 1 drive(s) are ok|‘C:\ free’=22.79899GB;20;10;0;49.89941 ‘C:\ free %’=46%;40;20;0;100

/usr/local/nagios/libexec/check_nrpe -H terminator -c check_drivesize -a drive=* “filter=size>1G” “warn=free<20G” “crit=free<10G” "detail-syntax=%(drive_or_name)" OK All 1 drive(s) are ok|‘C:\ free’=22.79899GB;20;10;0;49.89941 ‘C:\ free %’=46%;40;20;0;100

/usr/local/nagios/libexec/check_nrpe -H terminator -c check_drivesize -a drive=* “filter=size>1G” “warn=free<20G” “crit=free<10G” "detail-syntax=%(erasable)" OK All 1 drive(s) are ok|‘C:\ free’=22.79899GB;20;10;0;49.89941 ‘C:\ free %’=46%;40;20;0;100

And it’s exactly the same for every single variable.

Thanks for any help.


#2

Add show-all on the command line

check_drivesize drive=* "filter=size>1G" "warn=free<2M" "crit=free<1M" "detail-syntax=%(erasable)"
L        cli OK: OK All 4 drive(s) are ok

check_drivesize drive=* "filter=size>1G" "warn=free<2M" "crit=free<1M" "detail-syntax=%(erasable)" show-all
L        cli OK: OK 0, 0, 0, 0

#3

Thanks Micke, that solves one problem but I think there is an issue with “top-syntax=%(problem_list)”? See below.

/usr/local/nagios/libexec/check_nrpe -H file01 -c check_drivesize -a drive=* “filter=size>1G” “warn=free<35G” “crit=free<10G” “detail-syntax=%(drive) - Total: %(size) - Used: %(used) (%(used_pct)%) - Free: %(free) (%(free_pct)%)” “top-syntax=%(status): %(problem_list)” show-all

All three drives have under 35GB free, but problem_list only returns one, C:…

*WARNING: C:* - Total: 79.655GB - Used: 62.746GB (79%) - Free: 16.909GB (21%), E:\ - Total: 499.997GB - Used: 465.023GB (94%) - Free: 34.974GB (6%), F:\ - Total: 239.997GB - Used: 210.792GB (88%) - Free: 29.205GB (12%)|‘C:\ free’=16.90877GB;27.87934;10;0;79.65527 ‘C:\ free %’=21%;34;12;0;100 ‘E:\ free’=34.97421GB;174.99897;10;0;499.99706 ‘E:\ free %’=6%;34;2;0;100 ‘F:\ free’=29.20539GB;83.99897;10;0;239.99706 ‘F:\ free %’=12%;34;4;0;100

Also, is there a way to reduce the number of decimal points displayed?

Total: 79.655GB - Used: 62.746GB (79%) - Free: 16.909GB (21%)

Thanks again.


#4

In your example all the drives are listed right?

  • C: - Total: 79.655GB - Used: 62.746GB (79%) - Free: 16.909GB (21%),
  • E:\ - Total: 499.997GB - Used: 465.023GB (94%) - Free: 34.974GB (6%),
  • F:\ - Total: 239.997GB - Used: 210.792GB (88%) - Free: 29.205GB (12%)

And there is currently no way to format the numbers i.e. control the number of digits…


#5

Yes, the drives listed are correct. I’m comparing this to the old client, 0.4.1, where OK status would display detailed-syntax too, not just if warning/critical. Example below.

OK: C:: Total: 39.7G - Used: 12.9G (32%) - Free: 26.8G (68%), E:: Total: 400G - Used: 305G (76%) - Free: 95.1G (24%), F:: Total: 300G - Used: 30.8G (10%) - Free: 269G (90%)

It also put a “< warning” next to the drive that had a warning or critical status. I cannot find a way to replicate this behaviour with the newer client.

WARNING: C:: Total: 39.7G - Used: 12.5G (31%) - Free: 27.2G (69%), E:: Total: 550G - Used: 534G (97%) - Free: 16.5G (3%) < warning, F:: Total: 500G - Used: 447G (89%) - Free: 52.6G (11%)


#6

Ahh, yes, that is not supported anymore…


#7

Well that is unfortunate :slight_smile:


#8

Is it really?

What is the usecase for having the information? You have the same information in the performance data which is much easier to read in the form of a graph right?


#9

I found it useful. Can you expand on the performance data and graphs? A link to a doc or something would be sufficient :slight_smile: