Jump to content

SSH, StderrRead


Recommended Posts

ohh yes it was an image

but sometimes for recurrent information retrieval (like cpu) it's really boring to log on by putty, enter user/pass and execute a command

this open up some ways, that's just what i wanted to say

Instead of pulling that info, I would get a background process on each machine pushing it regularly to SYSLOG or some other networked log file. Your admin process just needs to monitor that log and see if anybody hasn't checked in on time.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

you can pull or retrieve, that's a question of philosophy after

imagine that your server that "receives" all of this syslog just come down...

i always prefer a server that will take the info, rather than all of my clients have some rights to send their data to it

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

I know that this is not the original topic, but do you know a good & simple to install sshd for windows? Would be extremly cool to control windows from linux. :) I messed around with tcp-ip some time ago but I'm a little bit too shy to install this thing on our server. It would just be the perfect solution if I could monitor our network with nagios and exec commands if needed. (Currently I get some sms, that's huge, but "selfhealing" would be much nicer :D )

Link to comment
Share on other sites

It would just be the perfect solution if I could monitor our network with nagios and exec commands if needed

go check winnrpe_nt

that's what i've installed on our monitored servers and i've developed more script in autoit (compatible) to make more request

c u

Edited by arcker

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

I just wanted to say that thanks to the advice given by PsaltyDS I have managed to get my program working:

I can now automate various functions to my entire network over SSH (previously I had been using telnet - but for obvious reasons I changed). Here is the basic code, of course you need an ini file containing the host list and Plink installed.

#include <Constants.au3>


$numswitches = IniRead( "C:\myfile1.ini", "Switches", "Count", "0" )

for $x = 0 to $numswitches

$hostname = IniRead( "C:\myfile1.ini", "Switches", ( "Switch" & $x ) , "0" )




Dim $szIPADDRESS = TCPNameToIP($hostname)

$PID = Run(@comspec & " /c c:\plink.exe " &$hostname& " -pw xxxxx -l * -ssh ","",@SW_SHOW,$STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD)
DIM $sSTDOUT = "", $sSTDERR = ""
Do
    Sleep(10000)
    If StdoutRead($PID, 0, True) Then $sSTDOUT &= StdoutRead($PID) 
    If StderrRead($PID, 0, True) Then $sSTDERR &= StderrRead($PID) 
    
    If StringInStr ($sSTDERR, "The server's host key") Then 
        no_RSA_key()
   
    Else
        normal()
        EndIf
    
    ProcessClose($PID)

Until Not ProcessExists($PID)

next





;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Fuction stuff here
Link to comment
Share on other sites

I just wanted to say that thanks to the advice given by PsaltyDS I have managed to get my program working:

:) Your AutoIt-Fu is now very powerful, Grasshopper. Remember the wise words of Master Lee*: With great power comes great responsibility. :D

*That's Stan, not Bruce... :D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...