Hello,
I am quite new to Nagios and have reached the stage where I need to call external batch files which include argument. I have tested this using nrpe and it is successful although would like to use NCPA.
I have move the batch file 'check_windows_time.bat' to the /plugins directory.
From the windows server plugins directory using cli I run the batch file successfully using - the args after the.bat are ntp source and offset
check_windows_time 10.0.0.1 30 10 and receive the correct output -
OK: Time is+00.0250767s from 10.0.0.1:'Offset'=00s;30;10;0
How do I call this from the Nagios box using check_ncpa.py
from /usr/local/libexec
./check_ncpa.py -v -H 10.0.0.100 -t MyToken -P 5693 -M 'plugins/check_windows_time.bat' ???????
NCPA calling batch file with arguments ---- Help !
-
- Posts: 6
- Joined: Wed Nov 15, 2017 6:51 am
Re: NCPA calling batch file with arguments ---- Help !
What version of NCPA do you have?
I'm using the latest version 2.1.1 and check_ncpa.py version 1.1.2 (we are on 1.1.3 now)
You would have to make sure the bat file is /plugins directory of your windows machine.
Is where I put mine in, it's likely the same for you.
After that, I ran my check like this from my XI server. (192.168.3.242 is my windows machine)
I hope this helps!
I'm using the latest version 2.1.1 and check_ncpa.py version 1.1.2 (we are on 1.1.3 now)
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -V
Code: Select all
C:\Program Files (x86)\Nagios\NCPA\plugins\check_windows_time.bat
After that, I ran my check like this from my XI server. (192.168.3.242 is my windows machine)
Code: Select all
[root@localhost plugins]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.3.242 -t 'mytoken1' -P 5693 -M 'plugins/check_windows_time.bat' -a 'pool.ntp.org 30 10'
OK: Time is +00.0254118s from pool.ntp.org|'Offset'=00s;30;10;0
-
- Posts: 6
- Joined: Wed Nov 15, 2017 6:51 am
Re: NCPA calling batch file with arguments ---- Help !
Many thanks for your reply. I just needed to figure out the correct syntax for passing the args. It worked perfectly.
Thankyou.
Thankyou.
Re: NCPA calling batch file with arguments ---- Help !
Sounds good!
Are we okay to lock this thread?
Are we okay to lock this thread?
-
- Posts: 6
- Joined: Wed Nov 15, 2017 6:51 am
Re: NCPA calling batch file with arguments ---- Help !
Yes ok to lock
Re: NCPA calling batch file with arguments ---- Help !
Sounds good! I'll be closing this thread!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!