Allerlei Informationen zum NSClient.
Installation, Konfiguration und das reale Leben.
Installation
- Auswahl dem Host entsprechenden 32 oder 64Bit Client
- Monitoring Tool = OP5
- Setup Type = Typical
- Allowed Hosts = IP Adressen der Server welche mit dem Client Kommunizieren dürfen.
- Ready to Install = Install
- UAC = Yes
- Command Prompt mit Administrativen Rechten öffnen
- In das Verzeichnis wechseln in dem der dementsprechende NSClient liegt.
- msiexec /l* log.txt /quiet /i NSCP-0.5.0.65-x64.msi MONITORING_TOOL=OP5 CONF_CAN_CHANGE=1 NSCLIENT_PWD=““ ALLOWED_HOSTS=“OP5-MONITOR-SERVER-IP-ADDRESS-HERE“
NSCP-0.5.0.65-x64.msi und OP5-MONITOR-SERVER-IP-ADDRESS-HERE entsprechend anpassen.
In Arbeit
Wie könnte man ein Install Package mit allen Einstellungen vorbereiten um auf jedem Server das ganze flott zu installieren.
Gedanke: Per Powershell Befehl sollte man das auf jedem Host schön Pushen können.
Dieses Script sollte man ganz gut umbauen können.
#$computerList = "Server Name"
#$regVar = "Name of the package "
#$packageName = "Packe name "
$computerList = $args[0]
$regVar = $args[1]
$packageName = $args[2]
foreach ($computer in $computerList)
{
Write-Host "Connecting to $computer…."
Invoke-Command -ComputerName $computer -Authentication Kerberos -ScriptBlock {
param(
$computer,
$regVar,
$packageName
)
Write-Host "Connected to $computer"
if ([IntPtr]::Size -eq 4)
{
$registryLocation = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"
Write-Host "Connected to 32bit Architecture"
}
else
{
$registryLocation = Get-ChildItem "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
Write-Host "Connected to 64bit Architecture"
}
Write-Host "Finding previous version of `enter code here`$regVar…."
foreach ($registryItem in $registryLocation)
{
if((Get-itemproperty $registryItem.PSPath).DisplayName -match $regVar)
{
Write-Host "Found $regVar" (Get-itemproperty $registryItem.PSPath).DisplayName
$UninstallString = (Get-itemproperty $registryItem.PSPath).UninstallString
$match = [RegEx]::Match($uninstallString, "{.*?}")
$args = "/x $($match.Value) /qb"
Write-Host "Uninstalling $regVar…."
[diagnostics.process]::start("msiexec", $args).WaitForExit()
Write-Host "Uninstalled $regVar"
}
}
$path = "\\$computer\Msi\$packageName"
Write-Host "Installaing $path…."
$args = " /i $path /qb"
[diagnostics.process]::start("msiexec", $args).WaitForExit()
Write-Host "Installed $path"
} -ArgumentList $computer, $regVar, $packageName
Write-Host "Deployment Complete"
}
Konfiguration
In der Dokumentation des NSClient findet man den Eintrag für den Port
[/settings/NSClient/server]
; PORT NUMBER – Port to use for check_nt. port = 12489
Wenn man den OP5 Client Installiert, ist Port 1248 angegeben. Sollte man Migrieren muss man den Check in OP5 anpassen und dann auch den Port in der op5.ini
Bei einer neu Installation würde ich empfehlen die Einstellungen Beizubehalten!
Die Allowed Host sind jetzt in der Registry unter: HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\settings\default zu finden!
Um eigene Scripts ausführen zu können muss man folgenden Wert in der Registry aktivieren
Key: HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\settings\external scripts
Type: String Value (REG_SZ)
Name: allow arguments
Data: True
Key: HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\modules
Type: String Value (REG_SZ)
Name: AlloExternalScripts
Data: enable
VB Scripte
PS Scripte