Everyone
I switch to this one
My Host defined
Code: Select all
define host{
use windows-server ; Inherit default values from a template
host_name TGCS025 ; The name we're giving to this host
alias Windows 2008 Exchange 2010 ; A longer name associated with the host
_ALLOWEDUSERS administrator
address 10.2.8.36 ; IP address of the host
}
My Commands.cfg
Code: Select all
define command{
command_name check_windows_users
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users -a 2 3 "$_HOSTALLOWEDUSERS$"
}
My service cfg
Code: Select all
define service {
host_name TGCS025
service_description Windows Users
check_command check_windows_users
servicegroups AllServices
check_interval 1
use generic-service
}
Got this all from this page
https://exchange.nagios.org/directory/P ... s)/details
On the Host
The nsclient.ini
; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_users = scripts\\perl\\check_users.exe $ARG1$ $ARG2$ "$ARG3$"
On the local drive c:\program files\nsclient++\scripts\perl I have tinyperl installed created check_users.exe via tinyperl -bin check_users.pl check_users.exe
restarted nscp on the Host
NOW I get this error on Nagios
Windows Users Notifications for this service have been disabled
CRITICAL 09-06-2016 21:15:42 0d 12h 59m 47s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, ...) failed. errno is 2: No such file or directory
So I ran this
root@tgcs017:/usr/local/nagios/etc/objects# find /usr/ -name "check_nrpe"
/usr/lib/nagios/plugins/check_nrpe
check_nrpe is not in /usr/local/nagios/libexec/check_nrpe
contents of
root@tgcs017:/usr/local/nagios/etc/objects# ls /usr/local/nagios/libexec
check_apt check_dig check_flexlm check_ifstatus check_mem.sh check_ntp check_ping check_smtp check_ups utils.pm
check_breeze check_disk check_ftp check_imap check_mrtg check_ntp_peer check_pop check_ssh check_uptime utils.sh
check_by_ssh check_disk_smb check_http check_ircd check_mrtgtraf check_ntp_time check_procs check_swap check_users
check_clamd check_dns check_icmp check_load check_nagios check_nwstat check_real check_tcp check_wave
check_cluster check_dummy check_ide_smart check_log check_nntp check_oracle check_rpc check_time negate
check_dhcp check_file_age check_ifoperstatus check_mailq check_nt check_overcr check_sensors check_udp urlize
Not sure why this plugin is looking in that folder
Any ideas.
If I copy check_nrpe then I would have two of them don't think that is good correct?
UPDATE UPDATE UPDATE......................
I copied check_nrpe to /usr/local/Nagios/libexec
Now it runs but I get this error
Critical: administrator login is not in allowed users list.
If you see my host def I do have allowedusers as administrator
I wonder if this need to be the domain name \ user home\administrator
Update
home\administrator did not work
I am now thinking that administrator is not being passed to the command
I ran this from the command prompt on the host
C:\Program Files\NSClient++\scripts\perl>check_users 2 3 administrator
OK: 1 user logged in
Active Sessions: administrator
It worked
Thoughts