Hi. We can have one or more agents of a particular type running on our AIX and Solaris servers. As these agents have usually been installed into their own filesystems, I need to capture the filesystem names for auditing purposes. I've had a search through the forums can see something that fits the bill. I can grep for the process name (kuxagent) which will return the paths and user names the process is running as, but I'm having trouble combining them all on a one-liner command. Is there a way to pipe the grep into a df maybe?
If I understand your requirement, maybe this:
I tested it on Solaris and here is an excerpt of the output:
Normally on Solaris we use nawk, but this is so simple it works with even the antique awk. You still need to grep what you want.
Hi Perderabo. Thanks for your prompt reply. I'm really just looking for any of the filesystem names used by a particular process called kuxagent. So what I'm trying to do is find how many processes called kuxagent are running, capture the name of the user each process is running as, and then try and identify a filesystem name they're running from out of the results. Can I also ask what %-9s does?
I continue to believe that my line of code is what you want. If not, I must not understand what you need. But -9s is a right-justified field 9 characters in length for a string.
Last edited by Perderabo; 02-22-2011 at 03:12 PM..
Thanks Chubler_XL. I tried your version on Solaris but got the message:
df: (grep ) not a block device, directory or mounted resource
I need to have the command in a one-liner, unfortunately, as getting scripts copied to the servers is difficult but we can run commands on them and capture the output.
Is it possible to have the 'user' value piped into a df ~user on the same line after the grep so that it displays the filesystem in one go?
e.g.
This isn't working, but hopefully it explains (however badly!) what I'm trying to do.
Hi All,
I am trying to create a shell script which runs on my linux machine.
The requirement is so that,
ade createview xyz -> this steps creates a view
ade useview xyz -> we are entering inside the view
ade begintrans -> begin a transaction
My script has following code :
lets say... (2 Replies)
I have been trying to fill all available file space on my Solaris box for my project but have not been successful. I have tried the following script:
tr '\0' '\060' < /dev/zero | dd of=zero2.txt bs=1024 count=1953125
But the only thing i get in return is this:
"d: bad numeric argument:... (8 Replies)
Hi All,
I am trying to execute a command using ssh as below.
ssh user123@servername "which ctmcontb"
It is gving the error as below
no ctmcontb in /usr/bin /usr/sbin /opt/sysadm/bin
Not sure from where the PATH is getting picked up.
But When I login direclty to the server I am... (5 Replies)
Guys
I'm working to make in AIX script and I have some commands need to be excited by that script
Like the below commands ...
startsrc -s sshd
I want that executing to be in the background of the system I do not like to see the out put of that (3 Replies)
Hello,
I've been trying to run 'ls -1R | wc -l' inside of sub directories to in order to determine how big each folder is.
find . -maxdepth 1 -type d | while read folder
do
cd "$folder" &&
echo "$folder has $(ls -1R | wc -l) files" &&
cd ..
done
or
for... (3 Replies)
Hey all,
How do I execute a file at startup automatically.
From what I've read is that I need to put it into my .bashrc file. I'm not sure where to go from there. Can I just type commands into that and they'll run next time I restart my server?
Right now I have added these lines:
cd... (2 Replies)
Hi,
I need to execute the following unix command through my java code -
zip -e
When i execute this command from the command prompt, i am prompted for a password in the following manner -
Enter password:
Verify password:
Is it possible to provide the password inthe first command itself... (5 Replies)