Lets try this again...
I figured everyone had given of their time and knowledge to me that I'll
try to repay the favor. I made a translation from Portuguese to English
of the opmonagent.ini and the service-control.cmd files and have
attached them if anyone is interested. It really helped me to
understand what these files do and hopefully I can get these services
restarted now. Is there any manipulation of these files that is
necessary to get services restarted besides the general opmonagent.ini
file editing for port #, allowed from IP, etc? They are attached as txt
files as I couldn't send them the first attempt as a cmd file.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jay R.
Ashworth
Sent: Wednesday, July 16, 2008 7:53 AM
To: [email protected]
Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++
torestart services
On Wed, Jul 16, 2008 at 08:32:41AM -0300, Fernando Rocha wrote:
> This is Portuguese and we'll translate that for the next release.
I'm looking forward to it. :-)
Cheers,
-- jra
--
Jay R. Ashworth Baylink
[EMAIL PROTECTED]
Designer The Things I Think
RFC 2100
Ashworth & Associates http://baylink.pitas.com
'87 e24
St Petersburg FL USA http://photo.imageinc.us +1 727
647 1274
Those who cast the vote decide nothing.
Those who count the vote decide everything.
-- (Josef Stalin)
------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
@echo off
rem #####################################################################
rem # FileName: service-control.cmd #
rem # Writed by: Gustavo Araujo #
rem # Function: Plugin to stop, to initiate and to #
rem # restart services via NRPE. #
rem # Usage: service-control.cmd <servico> <start|stop|restart> #
rem #####################################################################
set SRVC=%1
set OPR=%2
IF %OPR% == start GOTO SRVCSTART
IF %OPR% == stop GOTO SRVCSTOP
IF %OPR% == restart GOTO SRVCRESTART
rem In case that it does not confer with no command shows usage
GOTO USAGE
:SRVCSTART
rem Search to see if the service already not this in execution
sc query %SRVC% |FIND /I "RUNNING" > null 2>&1
IF %errorlevel% == 0 GOTO STARTED
rem It tries To go up service
NET START %SRVC% > null
rem Resulted search of the command and shows success or fails
IF NOT %errorlevel% == 0 GOTO STARTERR
IF %errorlevel% == 0 GOTO STARTSUC
:STARTERR
ECHO It was not possible to initiate the service %SRVC%
EXIT 2
:STARTSUC
ECHO O swervice %SRVC% it was initiated successfully
EXIT 0
:STARTED
ECHO O Service %SRVC% already started
EXIT 1
:SRVCSTOP
sc query %SRVC% |FIND /I "STOPPED" > null 2>&1
IF %errorlevel% == 0 GOTO STOPPED
NET STOP %SRVC% > null
IF NOT %errorlevel% == 0 GOTO STOPERR
IF %errorlevel% == 0 GOTO STOPSUC
:STOPERR
ECHO It was not possible to stop the service %SRVC%
EXIT 2
:STOPPED
ECHO O service %SRVC% it is already stopping
EXIT 1
:STOPSUC
ECHO O service %SRVC% was stopped successfully
EXIT 0
:SRVCRESTART
NET STOP %SRVC% > null
NET START %SRVC% > null
IF NOT %errorlevel% == 0 GOTO RESTARTERR
IF %errorlevel% == 0 GOTO RESTARTSUC
:RESTARTERR
ECHO The service fails when restarting %SRVC%
EXIT 2
:RESTARTSUC
ECHO O service %SRVC% it was restarted successfully
EXIT 0
:USAGE
ECHO *service* start,stop,restart - The commands are case-sensitive
EXIT 1
:EOF
ECHO IT PASSED FOR EOF[OPMONAGENT]
enable=1
password=None
port=12489
allow_from=192.168.1.94
; if set to 1, opmonagent will try to autodetect language settings
autodetect_counters=1
; if autodectet_counters set to zero, need to specify which to use, otherwise,
default W2K
use_counters=W2K
max_connections=300
debuglevel=0
[NRPE]
enable=1
port=5666
command_timeout=60
allow_from=192.168.1.94
max_connections=300
debuglevel=1
[NRPECOMMAND]
;Used to test if the agent is functioning
test=c:\opmon\test.bat
;Used to verify if some configured service exists as automatic but that it is
not twirling
services=cmd /c cscript //NOLOGO "c:\opmon\check_all_services.wsf"
;Used to verify if some configured service exists as automatic but that it is
not twirling,
;however the Service Name or Name Display ignores passed by parameter, for
more than one separates for comma
services_exclude=cmd /c cscript //NOLOGO "c:\opmon\check_all_services.wsf"
/exclude:$ARG1$
;Used of generic form for plugins opservices.exe, passing for name_executable
parameter and more 8 possible parameters
;where a not used parameter must be passed 0
check_remote=c:\opmon\check_remote.cmd $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
$ARG6$ $ARG7$ $ARG8$ $ARG9$
;Used to initiate, to stop or to restartar a service, it must be passed for
parameter "Service Name" and "action"(stop, start or restart)
service_control=c:\opmon\service-control.cmd $ARG1$ $ARG2$
;It reads the content of an archive, that contains a line with a value
read_file=c:\opmon\read_file.bat $ARG1$
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.
::: Messages without supporting info will risk being sent to /dev/null