execute a program with NRPE

Subhendu Ghosh sghosh at sghosh.org
Mon Apr 17 20:56:27 CEST 2006


On Mon, 17 Apr 2006, tdelunel wrote:

> Thank you for your reply,
>
> The NRPE user I configured in the nrpe.cfg file is  "nagios":
> nrpe_user=nagios
> nrpe_group=nagios
>
> Putty is on the windows 2000 server, and the session is opened by an "admin" 
> user.
> What I want is to execute putty with this command:
> ---------
> putty.exe -ssh @IP -load "myprofile" -l "mylogin" -pw "mypassword"
> ---------
>
> How can I configure NRPE for having the same user name than my windows 
> session ? What I have to do ?
> The windows user name is of that kind:  "MySociety\admin"


Why do you want NRPE to open the SSH window?

Plink offer a much better batch ssh functionality.

Also if the plugin does not exit within the default timeout - Nagios will 
get an unknown error code.

>
>> Subhendu Ghosh wrote :
>> 
>> Putty needs access to the Desktop to open the window - is the NRPE user 
>> same as the desktop/console user?
>> 
>> If you are trying to run another ssh session form the windows host, try 
>> plink (command line ssh) that is part of the putty package.
>> 
> tdelunel wrote
>
>>> Hi,
>>> I'm using a v2 of nagios and check_nrpe and nrpe_nt.exe 0.8.
>>> I have some troubles with starting an .exe on a remote windows 2000 
>>> Server.
>>> Here is my config:
>>> nrpe.cfg
>>> ---------------
>>> allowed_hosts=127.0.0.1, at IPnagios
>>> dont_blame_nrpe=1
>>> debug=1
>>> command[putty]=c:\nrpe\putty.exe
>>> ---------------
>>> Other parameters are set to default.
>>> 
>>> On the Monitoring Computer i use the command:
>>> 
>>> ./chek_nrpe -H @ipHost -c putty
>>> 
>>> After 10 seconds i receive the following message:
>>> CHECK_NRPE: Socket timeout after 10 seconds
>>> 
>>> In the nrpe_nt log file on the remote host:
>>> "Host is askng command 'putty' to be run"
>>> "Running command: c:\nrpe\putty.exe"
>>> "Command completed with return code 5"
>>> "Bad return code for [The check didn't respond within the timeout]"
>>> 
>>> Putty is not started, but if I open the task manager, I can see that 
>>> putty.exe is present.
>>> If I try to kill the process, i receive the message "Acces Denied".
>>> In parallele, i tried to start a windows service (W32Time i.e) remotely. 
>>> So i copied the "sc.exe" file from a windows XP on my 2000 server, and i 
>>> wrote my command into the nrpe.cfg:
>>> -------------
>>> command[start_service]=c:\nrpe\sc.exe start "W32Time"
>>> command[stop_service]=c:\nrpe\sc.exe stop "W32Time"
>>> -------------
>>> Then i sent the command:
>>> ./check_nrpe -H @ipHost -c stop_service
>>> ./check_nrpe -H @ipHost -c start_service
>>> 
>>> The both commands work, it stops and restart my service correctly.
>>> 
>>> I don't understand why my command for putty doesn't work...
>>> Did I forget something in the configuration ?
>>> Help please ...!
>>> 
>> 
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> 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
>

-- 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
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





More information about the Users mailing list