Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I'm about to go crazy over this shell script thingy and crontab editing.
My final goal besides taking over the world and crown me to ultimate ruler of my brain, is to log a simple NETSTAT to a file at a 2 second interval between 6am - 6pm.
I'm no good at programming so all help is appreciated!
from commandline the netstat would look someting like:
netstat >> /home/guest/netstat.txt
how do i get it to run every 2 seconds in above mentioned time-span?
I've tried to write my own shell script. It wouldn't even work from commandline, and crontab wont go every 2 seconds so I'm stuck.
Not to thwart your in your quest for Ultimate Brain Domination, but why do you actually want to do this?
If we know the reasons we might be able to suggest faster, more efficient and exisiting (reinvent wheel) solutions.
I got these 2 windows 2003 terminalservers and the AES 5.2 UNIX system.
When the guys at marketing uses the unix system wich they do all the time, they usually print to pdf via acrobat, when they log in to the unix system they have to tell wich port they want to request the acrobat trough. sometimes the acrobat port is used and they have to logout and then login with a different portnumber.
I have no lagal rights to alter the login to the UNIX server so I tought I could log the traffic and then maybe give the users a span of ports not used by the server.
thats why I need the netstat, or is there a really smart linux way of doing this? I've done the netstat on the two terminalservers just to check if it works.. results: on each TS there is a txt file @ 1.213GB :P
Got one of my co-workers fixxin a script to sort out the junk from the things I need.
So we're talking about Adobe Distiller, right? And it is the UNIX version? Does the box run SNMP by any chance? If so, then it's easy to set up a line for showing ports in use by distiller. If there's no SNMP then it's still rather easy. While netstat is one way to list all ports in use it's way too broad (can't really select). So if you can grab the process ID of distiller (for instance with "pgrep" but a ps|grep should do too) it's easier to feed that info into a more selective app like "lsof" (in the GNU/Linux dialect "lsof -i -a -p $PID -Fn" should do) and parse that output into a list of used ports. If the box runs a webserver it's easy to make that a CGI that refreshes when asked for, which is better for performance, but that's icing on the cake.
So the yes/no questions are: distiller? UNIX? SNMP? lsof? And what is the process name called?
No distiller found, yes, UNIX AIX 5.2, SNMP not foud either, no lsof either:/
process names, for each user instance: sh, todayx, crom.exe
apparently it also can export to exel and stuff, so not only pdf, tough when a user logs in to the unix system, it starts a couple of new processes, havent had the chans to test any pgrep yet.
I noticed in the config file each user has for the unix system, there is a row "crmrshdport=131177"
without a port number assigned the user cannot log in.
I think i only have to monitor the sh process for each user, right?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.