|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Means to check if some process is running on "n" number of machines
Team,
I would like to know, if we have any command in Solaris to verify, if some process is listening on a port on a set of machines. for eg: Wrote the below script, and found that when a process is listening on that port, then it just waits there and doesnt come out. Rather, I would like the script to verify, if some process is listening on that port on that machine and then come out with appropriate message and process to verify a port on the next machine. telnet abc 33 telnet xyz 405 telnet bbb 54 Do we have any other alternative? Does lsof be useful? Please let me know on this. Thanks Sunil Kumar |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
First exchange ssh keys with all those servers and then: Code:
# ssh root@abc "netstat -a -f inet -P tcp | grep '.33 '" | awk '{print $NF}'
# ssh root@xyz "netstat -a -f inet -P tcp | grep '.405 '" | awk '{print $NF}'
# ssh root@bbb "netstat -a -f inet -P tcp | grep '.54 '" | awk '{print $NF}'Above should return word "LISTEN" Of course you can add some 'if' in script which will return true or false depends of what is the returned word. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Can I exchange the keys using a script with multiple machines? If yes, then can you please tell me how?
I dont want to login to SSH, rather just check, if its running on the remote machine, since I am not aware of the user credentials. Thanks Sunil Kumar |
|
#4
|
|||
|
|||
|
If you don't want to use ssh, then you can try nmap.
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Hi GP,
Can you please tell me as how to exchange ssh keys with all those servers using a script, without user intervention? Thanks Sunil Kumar |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Exchanging ssh keys is a one off exercise; there's no reason nor benefit for a script.
|
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Quote:
Code:
read foo < /dev/tcp/abc/33 && echo port 33 is open on host abc read foo < /dev/tcp/xyz/405 && echo port 405 is open on host xyz read foo < /dev/tcp/bbb/54 && echo port 54 is open on host bbb |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check number of "CPU physical and core"? | arm_naja | Solaris | 5 | 06-09-2011 05:43 AM |
| What "-a" operator means in "if" statement | aoussenko | Shell Programming and Scripting | 1 | 03-02-2011 10:30 AM |
| How to check "faulty" or "stalled" print queues - SAP systems? | newbie_01 | Solaris | 0 | 07-15-2010 09:40 AM |
| script running with "ksh" dumping core but not with "sh" | simhe02 | HP-UX | 9 | 11-04-2008 07:52 PM |
| Command to find out "count" of running process ? | MITESH KOTHARI | Shell Programming and Scripting | 4 | 04-01-2008 03:27 AM |
|
|