Module: check_mk
Branch: master
Commit: 368228e1ee3aa6fa234e5b64818bae077819de68
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=368228e1ee3aa6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Jul 7 08:08:17 2015 +0200
added license header to kaspersky_av_client and mcafee_av_client windows plugins
---
agents/windows/plugins/kaspersky_av_client.vbs | 57 ++++++++++++++++++++++++
agents/windows/plugins/mcafee_av_client.bat | 15 +++++++
2 files changed, 72 insertions(+)
diff --git a/agents/windows/plugins/kaspersky_av_client.vbs
b/agents/windows/plugins/kaspersky_av_client.vbs
new file mode 100644
index 0000000..83973f5
--- /dev/null
+++ b/agents/windows/plugins/kaspersky_av_client.vbs
@@ -0,0 +1,57 @@
+' -----------------------------------------------------------------------------
+' Check_MK windows agent plugin to gather information abount fullscan age and
+' signature date of Kaspersky Anti-Virus software.
+' -----------------------------------------------------------------------------
+
+Option Explicit
+dim strRegLoc, strStatisticsLoc, strSignDateLoc, strKasUpdateLoc, strKasFullscanLoc,
strKasFullscanStateLoc, strKasRes
+dim objShell, objStdOut
+dim strBIASLoc, strBIAS
+dim value
+
+
+Set objShell = CreateObject("WScript.Shell")
+
+Function UTC2Local(TimeStamp)
+ UTC2Local = DateAdd("n", strBIAS, CDate(TimeStamp))
+End Function
+
+Function Kasp2Win(TimeStamp)
+ dim strTimeStampRepl
+ strTimeStampRepl = Replace(TimeStamp, "-", ".", 1, 2)
+ Kasp2Win = Replace(strTimeStampRepl, "-", ":")
+End Function
+
+strBIASLoc =
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"
+strStatisticsLoc =
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\KasperskyLab\Components\34\1103\1.0.0.0\Statistics\AVState\"
+strSignDateLoc = strStatisticsLoc & "Protection_BasesDate"
+
+on error resume next
+value = objShell.regread (
"HKLM\SOFTWARE\Wow6432Node\KasperskyLab\protected\AVP80\Data\LastSuccessfulFullScan"
)
+if err.number = 0 then
+ strRegLoc = "HKLM\SOFTWARE\Wow6432Node\KasperskyLab\protected\AVP80\Data\"
+else
+ err.number = 0
+ value = objShell.regread (
"HKLM\SOFTWARE\Wow6432Node\KasperskyLab\protected\KES8\Data\LastSuccessfulFullScan"
)
+ if err.number = 0 then
+ strRegLoc = "HKLM\SOFTWARE\Wow6432Node\KasperskyLab\protected\KES8\Data\"
+ else
+ Set fso = CreateObject ("Scripting.FileSystemObject")
+ Set stderr = fso.GetStandardStream (2)
+ stderr.WriteLine "Kaspersky version not compatible with this plugin, check
registry path."
+ end if
+
+end if
+
+'The following registry key just contains the information when the signatures were
synced from the admin server:
+'strKasUpdateLoc = strRegLoc & "LastSuccessfulUpdate"
+strKasFullscanLoc = strRegLoc & "LastSuccessfulFullScan"
+strKasFullscanStateLoc = strRegLoc & "LastFullScanState"
+
+
+strBIAS = -objShell.RegRead(strBIASLoc)
+strKasRes = objShell.RegRead(strSignDateLoc)
+WScript.Echo("<<<kaspersky_av_client>>>")
+WScript.Echo("Signatures " & UTC2Local(Kasp2Win(strKasRes)))
+strKasRes = objShell.RegRead(strKasFullscanLoc)
+WScript.Echo("Fullscan " & UTC2Local(Unix2Win(strKasRes)) & "
" & objShell.RegRead(strKasFullscanStateLoc))
diff --git a/agents/windows/plugins/mcafee_av_client.bat
b/agents/windows/plugins/mcafee_av_client.bat
new file mode 100644
index 0000000..ee324c2
--- /dev/null
+++ b/agents/windows/plugins/mcafee_av_client.bat
@@ -0,0 +1,15 @@
+@echo off
+rem # -----------------------------------------------------------------------------
+rem # Check_MK windows agent plugin to gather information about signature date
+rem # of Mcafee Anti-Virus software.
+rem # -----------------------------------------------------------------------------
+
+
+setlocal enableDelayedExpansion
+set dateval=
+
+for /f "tokens=3" %%a in ('reg query
"HKLM\SOFTWARE\McAfee\AvEngine" ^|find "AVDatDate" ^|find
"REG_SZ"') do @set dateval=%%a
+if not "%dateval%"=="" (
+ echo ^<^<^<mcafee_av_client^>^>^>
+ echo %dateval%
+)