I am looking to put in place a check for multipathing in a windows environment. I found a link to https://exchange.nagios.org/directory/P ... th/details and the code string, however I am having trouble getting this executed in powershell in a windows environment. Any assistance would be great or alternative solutions.
##Written by Calvin Bui 11-30-2015
cmd = `powershell.exe (gwmi -Namespace root\\wmi -Class mpio_disk_info).driveinfo`
error=0
storage= Hash.new
cmd.each_line do |line|
if line =~ /Name\s+:\s+MPIO\s+(\S+)/
$volume=$1
elsif line =~ /NumberPaths\s+:\s+(\d+)/
npath= $1
#puts $volume
#puts npath
storage[:"#{$volume}"] = npath
end
end
#keys= storage.keys
#puts "#{keys}"
storage.each do |name,p|
path = Integer(p)
if path == 8
print "OK:#{name}=#{path},"
else
print "CRITICAL:#{name}=#{path},"
error+=1
end
# puts "#{name} #{p}"
end
print "Number of Volumes with path down: #{error}"
if error > 0
exit(2)
else
exit(0)
end
Windows mpio multipathing check
Re: Windows mpio multipathing check
You would need to install ruby on the system in order to run ruby files, did you do that?
Open a powershell prompt as admin on the system and run this command:
Send us the full output.
Open a powershell prompt as admin on the system and run this command:
Code: Select all
powershell.exe (gwmi -Namespace root\\wmi -Class mpio_disk_info).driveinfo
Re: Windows mpio multipathing check
Thanks - so I got this working after installing Ruby, however the Security Team do not want Ruby installed on the servers.
Any Ruby to Powershell converters or whizzes out there?
Any Ruby to Powershell converters or whizzes out there?
Re: Windows mpio multipathing check
We do not have any official MPIO plugins at this time and I was unable to find any other plugins for this other than the one you found.
Nagios support does not have the time to convert the plugin for you nor do all of us in support know how to program. You'll either need to convert it yourself, write a different one, or pay someone else to do it.
We do offer paid custom development, if that is something you are interested in you can contact sales@nagios.com to get more information/a quote.
Let us know if you have any questions.
Thank you!
Nagios support does not have the time to convert the plugin for you nor do all of us in support know how to program. You'll either need to convert it yourself, write a different one, or pay someone else to do it.
We do offer paid custom development, if that is something you are interested in you can contact sales@nagios.com to get more information/a quote.
Let us know if you have any questions.
Thank you!
Re: Windows mpio multipathing check
Thanks - I will contact sales.