Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-IcingaCheckUsedPartitionSpace: Output usage/free space in MB/GB #5

Closed
log1-c opened this issue Dec 10, 2019 · 8 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@log1-c
Copy link

log1-c commented Dec 10, 2019

It would be nice to have the output of the check also tell the free/used values in MB/GB, not only the percentage :)

@LordHepipud
Copy link
Collaborator

Hello and thank you for the issue.
Do you want the output to be in the text or within the perf data output as well?

@LordHepipud LordHepipud added this to the v1.0.0 milestone Dec 18, 2019
@LordHepipud LordHepipud added the enhancement New feature or request label Dec 18, 2019
@log1-c
Copy link
Author

log1-c commented Dec 19, 2019

Both would be great 😄
Maybe similar to the output of the check_disk on Linux systems?
DISK OK - free space: / 8469 MB (79% inode=84%); /var 4774 MB (90% inode=98%); /tmp 1725 MB (99% inode=99%); /boot/efi 563 MB (98% inode=-);
image

Crited added a commit that referenced this issue Feb 7, 2020
#5 Adds according hidden output for the check, that uses the highest possible prefix.
@LordHepipud
Copy link
Collaborator

@Crited created a new branch for the plugin changes. Could you please test it and review the output? From our side this should be fine.

@log1-c
Copy link
Author

log1-c commented Feb 11, 2020

I checked the new Module.
Is it by design, that not all perfdata values are filled?
image
This leads to problems with the graphite module when using custom templates instead of the default one, at least for me.
Undefined index: icinga2.ST-WIN02-D-2103.services.Invoke-IcingaCheckUsedPartitionSpace.Invoke-IcingaCheckUsedPartitionSpace.perfdata.used_space_partition_c.value

I don't quite get how the script creates the output, else I would've added it myself.
Would be very awesome to have the Bytes in the text output and the perfdata completely filled <3

@LordHepipud
Copy link
Collaborator

I'm wondering why the max value is not set because the plugin output is printing it with 100%.

For warning and critical - this part seems to be missing. Im going to add it.

@log1-c
Copy link
Author

log1-c commented Feb 11, 2020

I'm playing around with the code atm.
I simply added -Minimum 0 -Maximum 100 to line 83, and it shows it in the output on the powershell

[DBG]: PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\plugins>> 
[WARNING] Check package "Used Partition Space" - [WARNING] Partition C 
\_ [WARNING] Partition C: Value "13.75%" is greater than threshold "10%"
| 'used_space_partition_c'=13.68GB;;;0;99.46 'partition_c'=13.75%;10;20;0;100 
1

but not in Icingaweb2 :S

Will be interesting to see how you add the warn/crit for the used bytes, because I can't figure it out^^
At least

$DiskWarning = [math]::Round(($DiskSize.Value / 100) * $Warning)
	  $DiskCritical = [math]::Round(($DiskSize.Value / 100) * $Critical)
      $IcingaCheckByte = New-IcingaCheck -Name ([string]::Format( 'Used Space Partition {0}', $Letter )) -Value $ByteValueConverted.Value -Unit $PerfUnit -Minimum 0 -Maximum $DiskSize.Value -Warning $DiskWarning -Critical $DiskCritical ;
      

does not work...

@LordHepipud
Copy link
Collaborator

Minimum and Maximum for % units is not required in general, as it will auto-set the range from 0-100 by default.

I just made another commit, adding the warning / critical values calculated from % input.

For the maximum I have no idea why it is not displaying

@log1-c
Copy link
Author

log1-c commented Feb 11, 2020

Thx a lot, looks good and the graphite template is working now as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants