Now my brain is thinking...in a single script, could I run the initial bit to create the headers one time, then only print the numbers after? Something silly like the following
while true
do
clear
date
echo
netstat -an | grep tcp |awk 'BEGIN...
LKBrwnDBA, thanks a bunch. For some reason, my data was not parsing right with the other awk's, but yours ( both of them ) sorted the data quite well. Thank you.
Here is a more fully developed script to account for states that had 0 connections. Data was being shifted around otherwise. Still not sure how to get the format I'm looking for in one go without scrubbing the data.
dt=`date +"%m%d%y%H%M%S"`
netstat -an | grep tcp | awk '{print $6}' | sort |...
This is on AIX 6 using KSH. I changed awk to gawk and getting the columns and some numbers.
4 5 6 7 1 2 3
FIN_WAIT_2 LAST_ACK LISTEN TIME_WAIT CLOSED CLOSE_WAIT ESTABLISHED
netstat -an | grep tcp | awk '{print $6}' | sort | uniq -c | sort -nr
294 FIN_WAIT_2
173 ESTABLISHED
83 TIME_WAIT
33 LISTEN
9 CLOSED
3 CLOSING
2 CLOSE_WAIT
1 SYN_RCVD
Would like the output to be in the following format instead
FIN_WAIT_2 ESTABLISHED TIME_WAIT LISTEN CLOSED CLOSING...
Getting the following error when running my query
DBD::mysql::st bind_columns failed: bind_columns called with 1 values but 25 are needed at ./getdata.pl line 42.
Is there a way for me to pull all the columns, but only print the five or six that I need witout having to bind each and every...
Getting the following error when running my query
DBD::mysql::st bind_columns failed: bind_columns called with 1 values but 25 are needed at ./getdata.pl line 42.
Is there a way for me to pull all the columns, but only print the five or six that I need witout having to bind each and every column?
i was printing &new_status, but not in the right spot, I moved it down and now it's working, but with results I didn't entirely expect. Not in a bad way, actually, might work better.
before:
host001 port25 down (Administratively down) node001
host002 port27 up node002
host003...
let me add that it's actually removing the entire column??
so this
host001 port25 down (Administratively down) node001
host002 port27 up node002
host003 port29 up node003
host004 port31 down (Administratively down) node004
to this
host001 port25 node001...
It appears to be removing the entire column. From this:
host001 port25 down (Administratively down) node001
to:
host001 port25 node001
I wondered if the parens needed escaped thinking perl may be trying to interpret them as part of the regex
=~ /^\(\w\)/;
But that didn't...
I've got a perl script running on AIX that issues an MySQL select against a table and pulls back four columns of data.
name port status host
I'm getting stuff in the status column that I want to remove, specifically in the column status, if I get
down (Administratively down)
I want to remove...
Are you wanting to have someone login and immediately not get a prompt, but go into a menu?
If so, you could have in their .profile something like
#!/bin/ksh
trap "exit" 2
PATH=.:/usr/bin:/usr/sbin:/usr/local/bin:
/usr/local/bin/adminmenu
trap 2
exit
Then have the adminmenu script that is...
The server was built from a mksysb NIM image of another server by another tech who is out.
Our monitoring software needs to be able to pull the OS type ( AIX, Linux, etc ) and it uses the uname command to get this.
Normal uname -a shows:
AIX server01 6 00C000000C00
But on this server, it...
Anyone here have experience with tripwire? Trying to have it only monitor one directory. However, that directory has over 37k files :O
I am getting this when trying to run tripwire --init -polfile ../etc/tw.pol
Please enter your local passphrase:
Parsing policy file...
quick update ( trying not to spam the list ) but I got the following output now
Mon Oct 20 122355 2008, /tmp/xlogfile, Changed mtime ctime
Mon Oct 20 122455 2008, /tmp/dcfile001, Changed mode ctime
Mon Oct 20 122455 2008, /tmp/dcfile002, Changed uid ctime
Mon Oct 20 122555 2008, /tmp/xlogfile...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.