1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-05 01:53:44 +01:00

Perfdata improved for NSclient

This commit is contained in:
Páll Guðjón Sigurðsson 2010-06-10 19:05:47 +00:00
parent adf1af57eb
commit 4f54fd077c
3 changed files with 38 additions and 3 deletions

View File

@ -325,7 +325,7 @@ strInfo=""
Set colWMI = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfDisk_LogicalDisk")
for Each objWMI In colWMI
strOut = strOut & objWMI.Name & ", "
strPerfdata = strPerfdata & "'disk_read_" & objWMI.Name & "'=" & objWMI.DiskReadBytesPerSec & " " & "'disk_write_" & objWMI.Name & "'=" & objWMI.DiskWriteBytesPerSec & " " & "'disk_queue_" & objWMI.Name & "'=" & objWMI.CurrentDiskQueueLength & " "
strPerfdata = strPerfdata & "'disk_read_" & objWMI.Name & "'=" & objWMI.DiskReadBytesPerSec & " " & "'disk_write_" & objWMI.Name & "'=" & objWMI.DiskWriteBytesPerSec & " " & "'disk_queue_" & objWMI.Name & "'=" & objWMI.CurrentDiskQueueLength & " " & "'disk_reads_" & objWMI.Name & "'=" & objWMI.DiskReadsPerSec & " " & "'disk_writes_" & objWMI.Name & "'=" & objWMI.DiskWritesPerSec & " "
next
strResultTemp = "; Logical Disks: " & strOut & " | " & strPerfdata
Exit Function

View File

@ -1,4 +1,4 @@
' Copyright 2007 GroundWork Open Source Inc.
' Copyright 2010 Opin Kerfi ehf ok.is.
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
@ -11,7 +11,7 @@
' GNU General Public License for more details.
'
'
' Author Dr. Pall Sigurdsson <palli at opensource.is>
' Author Pall Sigurdsson <palli at opensource.is>
'*************************************************************************************************
strComputer = "."

View File

@ -0,0 +1,35 @@
' Copyright 2010 Opin Kerfi ehf ok.is.
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
' as published by the Free Software Foundation; version 2
' of the License.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
'
' Author Pall Sigurdsson <palli at opensource.is>
'*************************************************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.SWbemRefresher")
Set colDisks = objRefresher.AddEnum _
(objWMIService, "Win32_PerfRawData_Tcpip_NetworkInterface"). _
objectSet
objRefresher.Refresh
strOut = "Network Interfaces: "
strPerfdata = " | "
For Each objDisk in colDisks
objRefresher.Refresh
strOut = strOut & " " & objDisk.Name & " "
strPerfdata = strPerfData & " 'net_sent_" & objDisk.Name & "'=" & objDisk.BytesSentPerSec
strPerfdata = strPerfData & " 'net_recv_" & objDisk.Name & "'=" & objDisk.BytesReceivedPerSec
Next
Wscript.Echo strOut & strPerfdata