I run a script tailing a log in a remote server, like so:

ssh userx@someip tail -f /data/current.log|python2.7 monitorlog.py

There are dependencies and service requirements that disallows me to run the script off the remote server. (DB, ACLs, and path to another service is uses)

Is there a way I can tail and monitor a log without using the ssh userx@someip? I thought about generating RSA keys but I think you still need a user to ssh.

link|improve this question
1  
Not really a programming question, but no, there is no way to view a log file on a server without logging in somehow, or implementing some other such remote access technique. You can possibly set up something to stream the data over TCP or UDP to some other known address, but you will have to have login access somehow. – Femi Jun 30 '11 at 1:23
You can use netcat or offer the logfile in a nfs share and mount it. – THC4k Jun 30 '11 at 3:24
can't syslog do what you want ? It can export and then collect on a central server, on which you can run your python script. – petrus Jul 1 '11 at 0:12
petrus is right, syslog is definitely the best and simplest choice here. – Jodie C Jul 1 '11 at 1:46
feedback

migrated from stackoverflow.com Jul 1 '11 at 0:06

This question came from our site for professional and enthusiast programmers.

1 Answer

With ssh you always need a user to connect to a server or simply execute a command. You can juste tail your log file with netcat and get a netcat client to connect to it from a remote machine. But this can be a problem for the security. Or simply create a user who can juste read the logs.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.