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

Added performance counter for mode check_disks #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions check_eva/check_eva.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ def check_generic(command="ls disk full", namefield="objectname", perfdata_field
usedstoragespacegb = 0
occupancyalarmlvel = 0
warninggb = 0
gooddisks = 0
for i in objects:
systemname = i['systemname']
# Some versions of commandview use "objectname" instead of namefield
Expand Down Expand Up @@ -528,6 +529,12 @@ def check_generic(command="ls disk full", namefield="objectname", perfdata_field
add_perfdata("'%s%s'=%s " %
(identifier, field, i.get(field, None)))

# Count disks with operationalstate good
if command == "ls disk full":
if i['operationalstate'] == 'good':
gooddisks += 1
perfdata = "'Good Disks'=" + str(gooddisks)

# Disk group gets a special perfdata treatment
if command == "ls disk_group full":
totalstoragespacegb = float(i['totalstoragespacegb'])
Expand Down