Hello,
We're transitioning from NSClient to NCPA. We've been using NCPA-2.1.6.exe for Windows 2008 and above servers which has gone smooth. Unfortunately, we have a few Windows 2003 servers and are utilizing NCPA-1.8.1.exe which we're able to get up and running with the basic services (cpu, memory, disk, etc). The problem we're facing with NCPA-1.8.1.exe is getting a custom plugin (C:\Program Files\Nagios\NCPA\plugins\check_log_file.ps1) working. We're using check command check_xi_ncpa and below is the argument that's being passed, the error message, and the powershell script code. Any idea what may be going wrong? Thanks ahead of time.
Argument:
-t 'mytoken' -P 5693 -M 'plugins/check_log_file.ps1' -a 'E:\web\production\cache\scripterrorlog.txt'
Error Message:
Unable to run check on non-child node. Revise your query.
Powershell Script:
param(
[Parameter(Mandatory=$true)][string]$logfile
)
$ok = 0
$warning = 1
$critical = 2
$content = "Out of memory"
$content1 = "Out of string space"
$content2 = "Not enough storage"
$logresult = get-childitem $logfile | select-string $content -quiet
$logresult1 = get-childitem $logfile | select-string $content1 -quiet
$logresult2 = get-childitem $logfile | select-string $content2 -quiet
if (($logresult) -or ($logresult1) -or ($logresult2)){
Clear-Content $logfile
Write-Host "Critical: Content match within the log file"
exit $critical
}
Else {
Write-Host "OK: No content matches"
exit $ok
}
Windows 2003 and NCPA-1.8.1.exe Plugin Issue
-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
Re: Windows 2003 and NCPA-1.8.1.exe Plugin Issue
On the machines with the older ncpa agent installed (1.8.1), you would need to change your command from this:
to this:
Let us know if this helped.
Code: Select all
-t 'mytoken' -P 5693 -M 'plugins/check_log_file.ps1' -a 'E:\web\production\cache\scripterrorlog.txt'Code: Select all
-t 'mytoken' -P 5693 -M 'agent/plugin/check_log_file.ps1' -a 'E:\web\production\cache\scripterrorlog.txt'Be sure to check out our Knowledgebase for helpful articles and solutions!
-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
Re: Windows 2003 and NCPA-1.8.1.exe Plugin Issue
This change worked! Thank you
Re: Windows 2003 and NCPA-1.8.1.exe Plugin Issue
I am glad I could help! 
Be sure to check out our Knowledgebase for helpful articles and solutions!