Skip to content

Instantly share code, notes, and snippets.

View Bastian-Kuhn's full-sized avatar

Bastian Kuhn Bastian-Kuhn

View GitHub Profile
@wmbaum
wmbaum / lnx_if.bat
Created January 18, 2013 23:53
check_mk windows agent plugin for monitoring network interfaces and bandwidth.
@echo off
setlocal enableextensions enabledelayedexpansion
echo ^<^<^<lnx_if:sep^(58^)^>^>^>
set tmpfile="%temp%\check_mk-lnx_if_%random%%random%.txt"
wmic path Win32_PerfRawData_Tcpip_NetworkInterface get Name,CurrentBandwidth ^
,BytesReceivedPersec,PacketsReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,PacketsReceivedNonUnicastPersec ^
,BytesSentPersec,PacketsSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded /format:csv> %tmpfile%
set ifnum=0
for /F "tokens=2-20 skip=2 delims=," %%a in ('type %tmpfile%') do (