--- projects/cms/source/host/generic/statgrab.pl 2001/01/19 19:37:59 1.1 +++ projects/cms/source/host/generic/statgrab.pl 2001/01/20 18:50:28 1.2 @@ -2,8 +2,8 @@ #----------------------------------------------------------------- # Machine statistics grabber -# $Author: pjm2 $ -# $Id: statgrab.pl,v 1.1 2001/01/19 19:37:59 pjm2 Exp $ +# $Author: tdb $ +# $Id: statgrab.pl,v 1.2 2001/01/20 18:50:28 tdb Exp $ # # A Perl script to return various information about a host machine # by examining the output of some common Unix/Linux commands. @@ -21,6 +21,7 @@ $| = 1; # You'd be silly not to use this ;) use strict; +&include_osver(); &include_users(); &include_top(); @@ -84,4 +85,21 @@ sub include_top() { &print_pair("packet.memory.swap_in_use", $top =~ /([^\s]+?)[MG] swap in use/); &print_pair("packet.memory.swap_free", $top =~ /([^\s]+?)[MG] swap free/); +} + +sub include_osver() { + + # Find out details about the operating system + my($os_name) = `uname -s`; + my($os_release) = `uname -r`; + my($os_platform) = `uname -m`; + my($os_sysname) = `uname -n`; + my($os_version) = `uname -v`; + + &print_pair("packet.os.name", $os_name); + &print_pair("packet.os.release", $os_release); + &print_pair("packet.os.platform", $os_platform); + &print_pair("packet.os.sysname", $os_sysname); + &print_pair("packet.os.version", $os_version); + }