![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| (w)get web server's directories + bash script | reminiscent | Shell Programming and Scripting | 2 | 08-20-2008 12:21 PM |
| Able to ping server's private network | *Jess* | IP Networking | 3 | 01-10-2008 08:45 PM |
| Solaris - unknown hostname - how can I change hostname? | XNOR | UNIX for Dummies Questions & Answers | 1 | 03-29-2007 10:52 PM |
| How to use another server's CD | FredSmith | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 12:28 PM |
| Linux server's | !_30 | Gentoo | 1 | 09-20-2006 03:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
get the server's hostname
i read that if i issue :
cat /etc/sysconfig/network > textfile i will be able to determine the hostname of the server that my linux workstation is connected to. but there are several other lines outputted that i do not need. i just need the hostname part. is there any other unix command i can use? i tried hostname, hostid but they give the name of the workstation, not the server's name. thanks for any leads |
|
||||
|
hostname, server's hostname
thanks pludi for quick reply.
i have to monitor several linux workstations connected to a linux server. i intend to issue cron jobs in each of the workstations to get the processes running and output the results to a textfile daily. so for every 30 minutes, cron job something like : 0,30 * * * * * ... ps c -FC "firefox-bin,soffice.bin, ..." >> textfile.txt the textfile.txt is to contain the workstation's hostname as part of the filename which i can get by issuing hostname at the workstation prompt. at the end of the day, the workstation has to copy that daily file to a subdirectory in the server. another cron job that i think will need the server's hostname this time. something like : cp textfile.txt serverhostname/assigned/directory/ (or ssh, ftp, scp whichever will be applicable, please suggest.) at end of the day, i should have 10 daily files coming from each of the 10 workstations at the serverhostname/assigned/directory/ as each of the textfile.txt contains the name of the workstation it came from, i can write a program to track which workstations are used more often and at what peak times for the processes being monitored from these log files. this is for the high school administrators/lab manager who want to monitor what the computers in their internet lab are being used for and at what times. i was worried that if the serverhostname is changed by the sysad at the server, my cron tasks and scripts will not run if i hardcode the serverhostname, thus my need to find it out from wherever (e.g. cat /etc/sysconfig/network > something.txt). thanks, just a newbie here. better leads how to accomplish above will be appreciated. (i also have another problem -- how to make the ps command accept the "watched executables" from a csv file that can later be expanded instead of hardcoding each of the additional executables in the ps statement) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|