Skip to content

Commit 1655346

Browse files
authored
Fixed overriding MONITORING_TOOL on command line (#998)
* Fixed installer docs * Fixed monitoring_tool override * adding timeout to test script * whoops: actually removed outdated entries
1 parent f9958ea commit 1655346

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

docs/docs/installing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ The MSI file can be customized during the installer. The following keys are avai
9999

100100
### Features
101101

102-
NSClient++ consists of the following features most which can be disable when doing silent installs.
102+
NSClient++ consists of the following features most which can be disabled when doing silent installations.
103103

104104
| Feature Name | Title | Description |
105-
| ------------------- | ---------------------- | ----------------------------------------------------------------------------------------- |
105+
|---------------------|------------------------|-------------------------------------------------------------------------------------------|
106106
| CheckPlugins | Check Plugins | Various plugins to check your system. (Includes all check plugins) |
107-
| Documentation | Documentation (pdf) | Documentation for NSClient++ and how to use it from Nagios |
108-
| DotNetPluginSupport | .net plugin support | Support for loading modules written in .dot net (Requires installing .net framework) |
109107
| ExtraClientPlugin | Various client plugins | Plugins to connect to various systems such as syslog, graphite and smtp |
110108
| FirewallConfig | Firewall Exception | A firewall exception to allow NSClient++ to open ports |
111109
| LuaScript | Lua Scripting | Allows running INTERNAL scripts written in Lua |
112110
| NRPEPlugins | NRPE Support | NRPE Server Plugin. Support for the more versatile NRPE protocol (check_nrpe) |
113111
| NSCAPlugin | NSCA plugin | Plugin to submit passive results to an NSCA server |
112+
| CheckMK | Check MK support | Experimental support for check_mk server and clients |
113+
| ElasticPlugin | Elastic Search support | Support for submitting metrics to elastic |
114114
| NSCPlugins | check_nt support | NSClient Server Plugin. Support for the old NSClient protocol (check_nt) |
115115
| PythonScript | Python Scripting | Allows running INTERNAL scripts written in Python |
116116
| SampleScripts | Scripts | Scripts for checking and testing various aspects of your computer and NSClient++ |

installer_lib/installer_helper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class msi_helper {
106106
std::wstring old = getMsiPropery(PREFIX_KEY + key);
107107
if (old.empty()) {
108108
logMessage(L" -- Setting " + std::wstring(PREFIX_KEY) + key + L" to '" + val + L"' as it was empty");
109-
setMsiProperty(key, val);
109+
setMsiProperty(PREFIX_KEY + key, val);
110110
}
111111
}
112112
void setPropertyKeyAndDefault(std::wstring key, std::wstring value, std::wstring old_value) {

tests/msi/helpers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def delete_registry_tree(root, subkey):
3030
raise e
3131

3232
def ensure_uninstalled(msi_file, target_folder):
33-
uninstall = run(["msiexec", "/x", f"{msi_file}", "/q"])
33+
try:
34+
uninstall = run(["msiexec", "/x", f"{msi_file}", "/q"], timeout=120)
35+
except Exception as e:
36+
print(f"! Uninstall process failed: {e}", flush=True)
37+
exit(1)
3438
if uninstall.returncode == 1605:
3539
print("- No installation found, continuing with install.", flush=True)
3640
elif uninstall.returncode == 0:
@@ -40,7 +44,7 @@ def ensure_uninstalled(msi_file, target_folder):
4044
exit(1)
4145

4246
print("- Killing any running NSClient++ processes.", flush=True)
43-
taskkill = run(["taskkill", "/F", "/IM", "nscp.exe"])
47+
run(["taskkill", "/F", "/IM", "nscp.exe"])
4448

4549

4650
delete_registry_tree(HKEY_LOCAL_MACHINE, r"Software\NSClient++")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
command_line: ["msiexec.exe", "/i", "$MSI-FILE", "/qn", "/l*", "log.txt", "ADDLOCAL=ALL", "TLS_VERIFY_MODE=none", "TLS_VERSION=1.2", "CONFIGURATION_TYPE=https://raw.githubusercontent.com/mickem/nscp/refs/heads/main/tests/rest/nsclient.ini", "MONITORING_TOOL=none" ]
2+
replace_password: true
3+
boot.ini: |
4+
[settings]
5+
1 = https://raw.githubusercontent.com/mickem/nscp/refs/heads/main/tests/rest/nsclient.ini
6+
[tls]
7+
verify mode = none
8+
version = 1.2
9+
10+
nsclient.ini: ""
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
command_line: ["msiexec.exe", "/i", "$MSI-FILE", "/qn", "/l*", "log.txt", "ADDLOCAL=ALL", "MONITORING_TOOL=none" ]
2+
replace_password: true
3+
boot.ini: |
4+
[settings]
5+
1 = ini://${shared-path}/nsclient.ini
6+
7+
nsclient.ini: ""

0 commit comments

Comments
 (0)