1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 18:33:45 +01:00
This commit is contained in:
Páll Guðjón Sigurðsson 2010-05-31 15:54:59 +00:00
parent 34382cac8c
commit 4a597d7734

View File

@ -281,6 +281,7 @@ strInfo=""
Dim objWMIService, colWMI,objWMI Dim objWMIService, colWMI,objWMI
strResultTemp = "" strResultTemp = ""
strOut = "" strOut = ""
strPerfdata = ""
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\" & strNameSpace) Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\" & strNameSpace)
f_Error() f_Error()
'Depend on strInfo parameters to get the result value 'Depend on strInfo parameters to get the result value
@ -315,16 +316,18 @@ strInfo=""
Set colWMI = objWMIService.ExecQuery("Select * from Win32_PerfRawData_Tcpip_NetworkInterface") Set colWMI = objWMIService.ExecQuery("Select * from Win32_PerfRawData_Tcpip_NetworkInterface")
for Each objWMI In colWMI for Each objWMI In colWMI
strOut = strOut & objWMI.Name & ", " strOut = strOut & objWMI.Name & ", "
strPerfdata = strPerfdata & "'net_sent_" & objWMI.Name & "'=" & objWMI.BytesSentPerSec & " " & "'net_recv_" & objWMI.Name & "'=" & objWMI.BytesReceivedPerSec & " "
next next
strResultTemp = "; Network Interfaces: " & strOut strResultTemp = "; Network Interfaces: " & strOut & " | " & strPerfdata
Exit Function Exit Function
else else
if(info = "logical_disks") then if(info = "logical_disks") then
Set colWMI = objWMIService.ExecQuery("Select * from Win32_LogicalDisk") Set colWMI = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfDisk_LogicalDisk")
for Each objWMI In colWMI for Each objWMI In colWMI
strOut = strOut & objWMI.Name & ", " strOut = strOut & objWMI.Name & ", "
strPerfdata = strPerfdata & "'disk_read_" & objWMI.Name & "'=" & objWMI.DiskReadBytesPerSec & " " & "'disk_write_" & objWMI.Name & "'=" & objWMI.DiskWriteBytesPerSec & " " & "'disk_queue_" & objWMI.Name & "'=" & objWMI.CurrentDiskQueueLength & " "
next next
strResultTemp = "; Logical Disks: " & strOut strResultTemp = "; Logical Disks: " & strOut & " | " & strPerfdata
Exit Function Exit Function
else else
if(info = "installed_services") then if(info = "installed_services") then