Use > Server Automation > SA Global Shell > Global Shell examples > Getting server information from the OGFS

Getting server information from the OGFS

List the Object ID and of the server named m256.opsware.com:

cd /opsw/Server/@/m256.opsware.com
cat self:i ; echo

(The preceding echo command is optional. It generates a new line character, which makes the output easier to read. The semicolon separates bash statements entered on the same line.)

List the name of the server with an Object ID of 340039:

cat  /opsw/.Server.ID/340039/self


By iterating through the server names with a for loop in bash, display the platform (operating system) name for each server:

cd /opsw/Server/@
for SERVER_NAME in *
do
   cat $SERVER_NAME/attr/platform
done

Display the amount of RAM in the server named abc.opsware.com:

cd /opsw/Server/@/abc.opsware.com
grep Quantity Memory/RAM/info


Display the network interfaces of a the server named blizzard.opsware.com:

cd /opsw/Server/@/glengarriff.snv1.dev.opsware.com/Interface
for INTERFACE_NAME in *  
do 
   echo ............. $INTERFACE_NAME ............
   grep  Interface "$INTERFACE_NAME/info"
   echo ""
done