Windows mpio multipathing check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jdk
Posts: 11
Joined: Tue Mar 31, 2020 2:48 am

Windows mpio multipathing check

Post by jdk »

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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows mpio multipathing check

Post by ssax »

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:

Code: Select all

powershell.exe (gwmi -Namespace root\\wmi -Class mpio_disk_info).driveinfo
Send us the full output.
jdk
Posts: 11
Joined: Tue Mar 31, 2020 2:48 am

Re: Windows mpio multipathing check

Post by jdk »

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?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows mpio multipathing check

Post by ssax »

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!
jdk
Posts: 11
Joined: Tue Mar 31, 2020 2:48 am

Re: Windows mpio multipathing check

Post by jdk »

Thanks - I will contact sales.
Locked