Sponsored Content
Top Forums Shell Programming and Scripting netstat command to be executed for list of hosts Post 302867589 by Yoda on Thursday 24th of October 2013 12:53:01 PM
Old 10-24-2013
Use ssh to remotely run the command:
Code:
#!/bin/ksh

while read name ipaddr
do
        ssh -n "$ipaddr" "netstat -i" 2> /dev/null | while read name mtu netdest addr ipkts ierrs opkts oerrs collis queue
        do
                [ "$name" = "Name" ] && continue
                [ $ierrs -gt 0 ] && print "Error message here"
                [ $oerrs -gt 0 ] && print "Error message here"
        done
done < "$Serverlist"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

netstat command between clustered hosts

I have 2 clustered hosts, is it possible for me to issue a netstat command against 1 host from the other ? (4 Replies)
Discussion started by: murphyboy
4 Replies

2. UNIX for Advanced & Expert Users

Netstat command

Hi.., Now, I am reading about the netstat command and its implementation. I have doubts in some options and its functionalities, natstat - M (Which is described as display masqueraded connections), what it means? What is Forwarding Information Base.?(--fib) Thanks in advance,... (3 Replies)
Discussion started by: nagalenoj
3 Replies

3. Cybersecurity

Help Required: Command to find IP address and command executed of a user

Hi, I am trying to write a script which would figure out who has run which command and their IP. As i dont have any clue as to which commands would do this job, i request some gurus to help me on this. Thanks Vishwas (2 Replies)
Discussion started by: loggedout
2 Replies

4. UNIX for Dummies Questions & Answers

Netstat command query

hy guys, I did netstat and it is listening, what can i do from the client side that to see if the port is open? Regards Charneet (1 Reply)
Discussion started by: charneet
1 Replies

5. Solaris

Check executed commands from remote hosts

Hello, Is there any way to check which user and from which IP executed a command to the server.I need something like the history but with information also from which IP the command executed. Thanks in advance (8 Replies)
Discussion started by: @dagio
8 Replies

6. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

7. Shell Programming and Scripting

netstat command

Hi, In my project we use sftp with batch mode (password less) script in parallel for 14 sessions which connects to 2 different servers alternatively i.e. 7 connects to one server say server1 and the other 7 connects to say server 2. Now the problem is that these 14 sessions are run in... (5 Replies)
Discussion started by: dips_ag
5 Replies

8. UNIX for Dummies Questions & Answers

Need help with a netstat command

Do I have this command correct to show all current connections/sessions my Solaris box has? It does not seem to do anything. netstat -an | grep EST (6 Replies)
Discussion started by: SIFT3R
6 Replies

9. UNIX for Dummies Questions & Answers

Set Command to output a log of every command executed in the script

Hi Guys, I like to output every command executed in the script to a file. I have tried set -x which does the same. But it is not giving the logs of the child script which is being called from my script. Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies

10. UNIX for Dummies Questions & Answers

List commands executed on a server

Hi All, how to list all the commands executed by users on a linux server.... I dont have access to others .bash_history. and i am not root user.. Please help.. Thanks in advance.. (6 Replies)
Discussion started by: nanz143
6 Replies
GNOME-SSH-ASKPASS(1)					      General Commands Manual					      GNOME-SSH-ASKPASS(1)

NAME
gnome-ssh-askpass - prompts a user for a passphrase using GNOME SYNOPSIS
gnome-ssh-askpass DESCRIPTION
gnome-ssh-askpass is a GNOME-based passphrase dialog for use with OpenSSH. It is intended to be called by the ssh-add(1) program and not invoked directly. It allows ssh-add(1) to obtain a passphrase from a user, even if not connected to a terminal (assuming that an X display is available). This happens automatically in the case where ssh-add is invoked from one's ~/.xsession or as one of the GNOME startup pro- grams, for example. In order to be called automatically by ssh-add, gnome-ssh-askpass should be installed as /usr/bin/ssh-askpass. ENVIRONMENT VARIABLES
The following environment variables are recognized: GNOME_SSH_ASKPASS_GRAB_SERVER Causes gnome-ssh-askpass to grab the X server before asking for a passphrase. GNOME_SSH_ASKPASS_GRAB_POINTER Causes gnome-ssh-askpass to grab the mouse pointer using gdk_pointer_grab() before asking for a passphrase. Regardless of whether either of these environment variables is set, gnome-ssh-askpass will grab the keyboard using gdk_keyboard_grab(). AUTHOR
This manual page was written by Colin Watson <cjwatson@debian.org> for the Debian system (but may be used by others). It was based on that for x11-ssh-askpass by Philip Hands. GNOME-SSH-ASKPASS(1)
All times are GMT -4. The time now is 04:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy