Skip to content

Instantly share code, notes, and snippets.

@ReallyLikesNutella
Created July 2, 2014 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ReallyLikesNutella/9630a0a1bbc478f7e669 to your computer and use it in GitHub Desktop.
Save ReallyLikesNutella/9630a0a1bbc478f7e669 to your computer and use it in GitHub Desktop.
Nagios plugin to check VNXe for hardware faults
#!/usr/bin/env python
#Dan Cottam - 20140702
#Check VNXe for hardware faults
#Requires Navisphere CLI
import sys,subprocess
cmd = subprocess.Popen("/opt/Navisphere/bin/naviseccli -User <username> -Password <password> -Address <address> -Scope 0 faults -list", shell=True, stdout=subprocess.PIPE)
rawquery = cmd.communicate()[0]
faultsquery = rawquery.strip()
if faultsquery == 'The array is operating normally.':
print faultsquery
sys.exit(0)
elif faultsquery != expectedfaultquery:
print "Error, query returned: " + faultsquery
sys.exit(2)
else:
print "Error code 0 (Something went wrong)"
sys.exit(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment