Module: check_mk
Branch: master
Commit: 46fe9362f092ce2e82ab021380d9da0008dc8b7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46fe9362f092ce…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 19 17:30:41 2015 +0200
#2276 mk_inventory.ps1: now uses directory ./state for its statefiles
---
.werks/2276 | 9 +++++++++
ChangeLog | 1 +
agents/windows/plugins/mk_inventory.ps1 | 10 +++++-----
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/.werks/2276 b/.werks/2276
new file mode 100644
index 0000000..c682af3
--- /dev/null
+++ b/.werks/2276
@@ -0,0 +1,9 @@
+Title: mk_inventory.ps1: now uses directory ./state for its statefiles
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1432049391
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 18afc18..33f487c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -181,6 +181,7 @@
* 2274 windows agent: "check_mk_agent.exe test" now also outputs stderr of
plugins...
* 2275 windows agent: new subfolders, improved folder cleanup during uninstall...
NOTE: Please refer to the migration notes!
+ * 2276 mk_inventory.ps1: now uses directory ./state for its statefiles
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/agents/windows/plugins/mk_inventory.ps1
b/agents/windows/plugins/mk_inventory.ps1
index 3f0f0c7..a9b1b64 100644
--- a/agents/windows/plugins/mk_inventory.ps1
+++ b/agents/windows/plugins/mk_inventory.ps1
@@ -10,14 +10,14 @@ $name = (Get-Item env:\Computername).Value
$separator = "|"
# filename for timestamp
$remote_host = $env:REMOTE_HOST
-$agent_dir = $env:MK_CONFDIR
+$state_dir = $env:MK_STATEDIR
-# Fallback if the (old) agent does not provide the MK_CONFDIR
-if (!$agent_dir) {
- $agent_dir = "c:\Program Files (x86)\check_mk"
+# Fallback if the (old) agent does not provide the MK_STATEDIR
+if (!$state_dir) {
+ $state_dir = "c:\Program Files (x86)\check_mk\state"
}
-$timestamp = $agent_dir + "\timestamp."+ $remote_host
+$timestamp = $state_dir + "\timestamp."+ $remote_host
# does $timestamp exist?
If (Test-Path $timestamp){