Re: Not able to Run Powershell Script using NRPE
Posted: Thu Mar 24, 2016 3:10 pm
Can you post the "nsclient.log" file?CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Support for Nagios products and services
https://support.nagios.com/forum/
Can you post the "nsclient.log" file?CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
I have attached the log file.lmiltchev wrote:Can you post the "nsclient.log" file?CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Code: Select all
nscp settings --generate --add-defaults --load-allHi lmiltchev,lmiltchev wrote:Did you load the default settings in nsclient.ini file by running:from the CMD prompt?Code: Select all
nscp settings --generate --add-defaults --load-all
I suspect that running PS scripts fails because you are missing the "[/settings/external scripts/wrappings]" section.
Add the "defaults" AND restart the NSClient++ service.
Next, upload the "updated" nsclient.ini file, so that we can review it. We may need to modify some of the "timeout" settings in case this is what is causing the problem.
Code: Select all
if (($CPUQueue -gt $CPUq) -and ($CPUpercent -gt $CPUp)) {
...
}Code: Select all
if (($CPUQueue -lt $CPUq) -and ($CPUpercent -gt $CPUp)) {
...
}Code: Select all
[root@localhost nagiosxi]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c myscript -a 'myPC -memwarn 85 -memcrit 95 -CPUq 1 -CPUp 0'
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
1329 175 538800 669784 1597 ...71.21 1304 firefox
CRITICAL: CPU Queue = 0 CPU% = 13. firefox is using the most resources, its PID is 1304 |'CPU'=13%;;;0 'CPU'=0 'Queue'=0;;;0Hi lmiltchev,lmiltchev wrote:Great! I am glad we are moving to the right direction.
The CPU usage would be shown if some conditions were met. You have the following condition in the script:
In my case, the "$CPUQueue" was 0 (zero), so I changed this condition to:Code: Select all
if (($CPUQueue -gt $CPUq) -and ($CPUpercent -gt $CPUp)) { ... }
for testing purposes (used "less than" instead of "greater than"), and tested it from the CLI to see if the CPU usage will be displayed.Code: Select all
if (($CPUQueue -lt $CPUq) -and ($CPUpercent -gt $CPUp)) { ... }
Hope this helps.Code: Select all
[root@localhost nagiosxi]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c myscript -a 'myPC -memwarn 85 -memcrit 95 -CPUq 1 -CPUp 0' Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 1329 175 538800 669784 1597 ...71.21 1304 firefox CRITICAL: CPU Queue = 0 CPU% = 13. firefox is using the most resources, its PID is 1304 |'CPU'=13%;;;0 'CPU'=0 'Queue'=0;;;0
A few lines here and there we can take care of, but anything more than that needs to be quoted as custom development. I can certainly start the conversation with sales and our developers if that is something you are interested in doing.CloudOps wrote:[can you modify the script accordingly? is it possible?
can you confirm if any cost is involved in this??tmcdonald wrote:A few lines here and there we can take care of, but anything more than that needs to be quoted as custom development. I can certainly start the conversation with sales and our developers if that is something you are interested in doing.CloudOps wrote:[can you modify the script accordingly? is it possible?
Before we do that though, I would need clarification on the examples you provided. You mention warning and critical behavior twice, but each mention seems to be the same scenario. Is there supposed to be any difference between the two?
Definitely - it is a custom development. It could be a very reasonable cost though, depending on how much time our developers will have to spend modifying the script. You can contacts our sales team at [email protected], and request a quote for a custom development.can you confirm if any cost is involved in this??
lmiltchev wrote:Definitely - it is a custom development. It could be a very reasonable cost though, depending on how much time our developers will have to spend modifying the script. You can contacts our sales team at [email protected], and request a quote for a custom development.can you confirm if any cost is involved in this??