Some of you might remember that Haggis announced on this forum late last year that he was writing a simple Linux system stats script. At first it started out really basic, but with the encouragement of other Neowin members he continued to improve it. Several of us even offered pointers or submitted patches to help fix bugs. As it evolved over the next several months Haggis added features and stability improvements until it became what I believe is one of the best scripts of its kind.
Since Haggis has not had much free time to work on it recently, I set out to fix some bugs in the script last weekend. In particular I noticed that while the script works well on my distro of choice, it spit out many ugly errors on typical Arch Linux installations. In the process of tracing and fixing these bugs I decided to rewrite the script in Perl. This major revision of Stats is much more fault tolerant, has explicit support for the most popular Linux distributions and desktop environments, has new switches to control behavior, and has significantly more documentation than the old BASH script.
Therefore Haggis and I are proud to present Haggis Stats 2.0!
Stats is a simple script to print basic system statistics and immortalize those results with a screenshot on GNU/Linux systems. The most popular Linux distributions are officially supported by this script, although any reasonable, modern GNU/Linux system should have no problem running it. It was written with typical end-user desktop installations in mind, but a limited subset of the functionality afforded to those systems is provided on headless machines. This script will automatically detect the functionality available and print the associated system information accordingly, or fail gracefully if it cannot.
Officially Supported Operating Systems
- Red Hat Enterprise Linux >= 6.0
- CentOS >= 6.0
- Fedora >= 15
- Debian >= 6.0
- Ubuntu >= 12.04
- Linux Mint >= 13
- Elementary OS >= 0.2
- Arch Linux
- openSUSE >= 12.3
- Perl 5.10 or later
- Perl Switch module
- Linux Standard Base core
- GNU Coreutils
- GNU PS
In most cases Stats really does not need to be installed. You can invoke it from the top level of its source directory using the command below.
If you wish to install Stats so it is available to all users on your system, you can do so one of two ways. If you are running Debian or a Debian-based distribution such as Ubuntu or Linux Mint, you can install the Debian package in the section below. Otherwise you can run the commands listed below as root to install the script manually. Typically prefixing each command with "sudo" or "su -c" will run it as root if you have not already assumed those privileges since entering the top-level of the Stats source directory.
# install -m 755 ./src/stats.pl /usr/local/bin/haggis-stats # install -m 755 -d /usr/local/man/man1 # install -m 644 ./man/stats.1 /usr/local/man/man1/haggis-stats.1 # gzip /usr/local/man/man1/haggis-stats.1
In addition to the manual installation method described above, I also developed a Debian package for Stats. I recommend that you use this package if you are running Debian, Ubuntu, or another Debian derivative. You can either click the appropriate link in the next section to download the package and double-click it in your file manager to install it with Synaptic, GDebi, Ubuntu Software Center, or your other graphical package manager of choice; or follow the instructions below to install it from the command line.
$ wget https://dl.dropboxusercontent.com/u/62647756/misc/stats/haggis-stats_2.1.0-1_all.deb $ sudo apt-get install scrot $ sudo dpkg -i haggis-stats*.deb $ sudo apt-get install -f $ haggis-stats
Majesticmerc has also written an Arch Linux package for Stats which he uploaded to the Arch User Repository. I recommend that you use this package if you are running Arch Linux or a derivative. You can download the PKGBUILD from the haggis-stats AUR page and install it using your preferred method, or follow the instructions below.
Arch Linux AUR Installation:
$ wget https://aur.archlinux.org/packages/ha/haggis-stats/haggis-stats.tar.gz $ tar xzf haggis-stats.tar.gz $ cd haggis-stats $ makepkg -s $ sudo pacman -U haggis-stats*.pkg.tar.xz
Stats 2.1.0 Source Tarball: https://dl.dropboxus...1.0.orig.tar.xz
Stats 2.1.0 Debian Tarball: https://dl.dropboxus...1.debian.tar.gz
Stats 2.1.0 Debian Package: https://dl.dropboxus...2.1.0-1_all.deb
Stats GitHub Repository: https://github.com/x...er/haggis-stats
Stats 1.x Thread: http://www.neowin.ne...em-stats-script
- New Feature: Elementary OS support
- New Feature: --output-dir option
- Bugfix: No screenshot attempt without an X session
- Bugfix: Improved support for headless systems
- Bugfix: Defaulted screenshot utility to scrot to fix "black" screenshots
- Complete rewrite in Perl
- New Feature: Command line switches
- New Feature: Diagnostic report generation
- New Feature: RHEL, CentOS, Arch, and openSUSE support
- Bugfix: lsb_release is no longer strictly required
- Bugfix: Improved support for headless systems
- New File: ChangeLog and NEWS
- New File: README
- New File: INSTALL
- New File: AUTHORS
- New File: Stats man page
We encourage you to test the script on your systems and report any bugs you encounter; even if they are for Linux distributions we do not officially support we will still try to fix them. For now this thread is the preferred form contact, although you are also welcome to PM Haggis or I if you wish.
When you report bugs it would be very helpful if you could include either a screenshot of Stats' output or a textual copy of the buggy output, and a diagnostic report. Diagnostic reports can be generated by the script using the "report" action. An example of a Stats report is below.
$ ./src/stats.pl report Diagnostic report written to /home/karl/stats-2.0.0/stats_report_karl_20130927.204227.log
Edited by xorangekiller, 03 October 2013 - 22:13.