Originally posted by: SystemAdmin
Hello
I am new user of AIX; I have only basic knowledge of the UNIX commands, and I want to create script that will monitor the performance and resources usage on AIX 6.1 machine.
Basically I wan to start a loop that will grab, every 10 seconds, the CPU usage, the memory usage, the disk usage, and the Network usage (especially the number of TCP connections that are not completely closed). And create an HTTP POST with all those information to send it to another machine on the same network.
I started the script after looking in some example in the internet, but I ma not sure if what I did until now is correct. Any help or ideas are welcome.
Thank you
##############################################
-
Script:
#################################################
#Script to monitor Machine resources.
-
Start loop
#Get CPU usage
cpu_usage = vmstat 1 1 |tail -1 | awk {'print $14'}
cpu_user_usage = sar -u 1 1 |tail -1 | awk {'print $2'}
#Get memory (RAM) usage
mem_usage = svmon -G | tail -1 | awk {'print $3'}
((mem_usage = mem_usage / 256))
mem_total=`lsattr -El sys0 -a realmem | awk {'print $2'}`
((mem_total = mem_total / 1000))
((mem_free = mem_total - mem_usage))
#Get Disk usage
#Get Network usage
#Get Time
#Get machine name
#Create HTTP request params
#Send HTTP request to Monitoring machine
-
end loop