Hi, I am working in an environment where we have 8 app server instances spread across 4 unix machines. There are other servers too. We need to monitor the log files from these servers on a regular basis. At present we use a hard token to enter into the datacenter from our network and usually hop around a few machines to get to the log files and we end up opening a dozen or so unix sessions. Can we write a small aplication which can pull these files and stream it to me periodically. For example a swing application.. My problem is how can make the application tunnel through the different machines ( given that there are only a few ports opened, I am told). Hope I explained my problem. Are there any products that do similar stuff ? How do I go about this task.. Any pointers are a lot of help. thanks sri
A better idea might be to have your servers log to a central log host. Then process/monitor your logs on that particular host. There are several loggers out there that will do that such as syslog-ng, even the standard syslog that comes on Unix machines will log to different hosts. You can do this via sockets in Java but it would probably be more work than it is worth considering there are open source tools out there that will do the work for you. If you want to have some sort of Swing interface on the front to look at logs on your central host then that is just a matter of reading in the log files and putting together a useful interface...
Well - if these machines are unixes, you could use cron and the crontab-files, to push the logfiles hourly. This could be done with ftp/ tftp. Using xmail to push the files would be a typical unix-solution too. If you want to implement a scheduler in java have a look at jquar(t)z - not sure about the 't'. If you insist in pulling, again I would think of using ftp to get the files - ftp was build for that .
Thank you for the information. Please bear with my lack of knowledge in networking related issues.Let me explain my situation better. In my environment, I can not do a ftp to any of the servers from my win2k desktop. To login to these servers, I use putty to connect to one particular machine which gives a number during the autorization to which I have to match with a number generated at that moment on a hardware token given to me. Once this is done I have to connect to a few of the machines again using putty. I login to yet other machines through some of these. This is the hopping I am talking about. To reach a machine z I go through a y and then to z using ssh in each stage. For example, I cannot access the appservers's admin consoles from my win2k unless I tunnel through putty. And that I can do only a few at a time. I have occasion to monitor more than 10 admin consoles at a time, to give you an idea. If I can make it happen it can save a lot of manual work. Now tell me, How can my swing application acheive the consolidation of all this. Appreciate your help. sri
posted 14 years ago
Again, your best bet would be to consolidate the logs at log time instead of trying to get them together at a later time. Small udp packets don't make much impact on the network, but large files going across do. Use a good logger to consolidate to a log host. This is just a good practice in general. If you cannot do this via that method there is a way to do this maybe via RMI but that would depend a lot on your network constraints. My guess is you wouldn't be able to do it anyway. Your network seems paranoid which is not a bad thing, but that makes it difficult to run the servers and clients you would need to do this.
yedi: and do you look at the logfiles using putty, or do you transfer them?
I used putty only once, and it's three years ago. I guess you may configure putty to use a special port / protocol, telnet or ssh.
Can you ask, which ports and protocols are open for your access?
A complicated solution would be to use the NetComponents.jar (google), create a Telnetsession with the parameters used by putty, and redirecting input/outputstreams, using Runtime, to start the ssh - session.
Perhaps there is a ssh-implementation available in Java too.