Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. tagyourit

    script output to columns with headers

    :D Giddyup! That works perfectly. Amazing work LKBrwnDBA, thanks a ton.
  2. tagyourit

    script output to columns with headers

    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...
  3. tagyourit

    script output to columns with headers

    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.
  4. tagyourit

    script output to columns with headers

    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 |...
  5. tagyourit

    script output to columns with headers

    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
  6. tagyourit

    script output to columns with headers

    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...
  7. tagyourit

    bind_columns called with 1 values but 25 are needed

    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...
  8. tagyourit

    only need 5 our of 25 columns returned

    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?
  9. tagyourit

    remove characters inline

    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...
  10. tagyourit

    remove characters inline

    ended up with this and it's working $STATUS =~ s/\(.*\)//; I think \w was matching and eliminating everything in that column.
  11. tagyourit

    remove characters inline

    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...
  12. tagyourit

    remove characters inline

    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...
  13. tagyourit

    remove characters inline

    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...
  14. tagyourit

    using tabs to align, $1 field too long

    This is what I ended up using | awk -F',' '{printf "%22s%10s%10s\n", $1,$4,$5}' Thanks PHV!
  15. tagyourit

    using tabs to align, $1 field too long

    Here's my output. YZ_DISKPOOL 0.0 0.0 XYZ_123_789_DISKPOOL 44.0 43.6 UX_DISKPOOL 0.3 0.0 UNIX_DISKPOOL 0.0 0.0 UNIX2_DISKPOOL 0.0 0.0 UNIX3_DISKPOOL 0.5 0.0 I'm taking input which is comma delimited and...
  16. tagyourit

    menu driven script

    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...
  17. tagyourit

    uname shows hostname, not OS ( AIX )

    uname -s showed the hostname. I ran the -T AIX and it set it back. Thank you!
  18. tagyourit

    uname shows hostname, not OS ( AIX )

    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...
  19. tagyourit

    tripwire segfault

    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...
  20. tagyourit

    formatting script output

    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...

Part and Inventory Search

Back
Top