#!/bin/ksh ############################################################################### # Project: ESRF/Linux # Description: Code snippet to demonstrate the use of SNMP database for the # version information retrieval. See the KickStart answer # file, workstation.cfg. # # Author(s): Staffan Ohlsson # European Synchrotron Radiation Facility, # Grenoble, France # # Original: August 2005 # # License: GNU General Public License, Version 2 ############################################################################### # # [snip] # # Get release/version/patchlevel and type from the SNMP database # snmp_string=`snmpget -v1 -c public localhost system.sysLocation.0` # # release (major release) # release=`echo $snmp_string | awk '{print $5}'` # # version (ESRF/Linux version), like a new linux version (suse72 -> suse82) # version=`echo $snmp_string | awk '{print $6}'` # # patching (bugfixes and critical patches) # patchlevel=`echo $snmp_string | awk '{print $7}'` # # gives information on the installation status # k = kickstart # p = postinstall # m = modified # install_status=`echo $snmp_string | awk '{print $8}'` # # gives information on patching rules # y = go ahead and patch # r = restricted patching - needs to be scheduled # n = no patching # patch_rule=`echo $snmp_string | awk '{print $9}'` # # gives which .cfg file was used on Kickstart server/Rembo Wizard # machine_type=`echo $snmp_string | awk '{print $10}'` # # [snip]