User Tools

Site Tools


perso:dump:mess:checksystem
#!/bin/bash

cd $HOME

# Nb total system process
echo Nb total system processes
ps -ef | wc -l | awk '{ print $1 }'
echo

# Disk usage and Log capacity
echo Free disk space and log size
df -k /home/mcm4 | grep -v Filesystem | awk '{ printf ("%s kB\n", $4) }'
ls -l pfs/log/MCM4.log | awk ' { print $11 } ' | xargs ls -l | awk '{ printf ("%s/1024\n", $5) }' | bc | awk '{ printf ("%s kB\n", $1) }'
du -sk gssc | awk '{ printf ("%s kB\n", $1) }'
echo

# Memory usage in pages
echo Memory usage in pages
ps -lu mcm4 | grep M[C]M | grep -v startMCM | awk '{ printf ("%s\t%s\n", $10, $14) }'
# Memory usage in kB
echo Memory usage in kB
ps -lyu mcm4 | grep M[C]M | grep -v startMCM | awk '{ printf ("%s\t%s\n", $9, $13) }'
echo

# Nb files opened
echo Nb files opened
ps -ef | grep M[C]M | grep -v startMCM | grep -v grep | awk '{ print $2 }' | xargs pfiles | grep mode: | wc -l | awk '{ print $1 }'
echo

# Nb threads
echo Nb threads
ps -ef | grep M[C]M | grep -v startMCM | grep -v grep | awk '{ print $2 }' | xargs ps -Lflp | wc -l | awk '{ print $1 }'
echo


# Nb total system process
echo Nb total system processes
ps -ef | wc -l | awk '{ print $1 }'
perso/dump/mess/checksystem.txt · Last modified: 2015/05/01 23:32 (external edit)