Wednesday, July 22, 2009

iStat Linux Server 0.5.3 RPM

Edit (July 24, 2009): Added 64-bit package. It can be found just under the original 32-bit download link.

The other day, I stumbled across the iStat iPhone App, which allows an administrator to view remote server statistics in a very nice graphical display on your iPhone. While the application developer, Bjango, only officially supplies iStat Server for Mac OS, they promote a third-party code base for iStat Server for Linux & Solaris. The third-party code base is still fairly rough, but it works and seems stable in my testing.

The main drawback to the Linux server is that, at the time of this writing, it is currently distributed as a tarball. Since I maintain several CentOS servers, I don't want to have to install development tools and compile the code on them all. So, I fired up my development CentOS VM and got to work. The result is an RPM that installs the iStat server, and provides a handy init script. I made a couple changes to the default configuration file to use the user "nobody" instead of creating an "istat" user for running a single daemon.

Download: istat-server-0.5.3-1.el5.rych.i386.rpm
MD5 Sum: 239a4d972bcc0d88dae2b93fdb998a07
SHA1 Sum: 7310322eb8aea479a2ce9a2ee59acca8b63a6083

Download: istat-server-0.5.3-1.el5.rych.x86_64.rpm
MD5 Sum: fc94b53bedb4afa3d9d6dcad08268628
SHA1 Sum: d38b5cdef670b5b6555df2558478985ae78e95b5

Installation is easy:

$ sudo rpm -hiv http://ryanchouinard.com/rpms/istat-server-0.5.3-1.el5.rych.i386.rpm

Once installed, edit the config file /etc/istat.conf with your editor of choice. Make sure to change the lines for server_code, monitor_net, and monitor_disk to suit your needs.

#
# /etc/istat.conf: Configuration for iStat server
#

# network_addr 127.0.0.1
# network_port 5109
server_code <Must be a 5 digit code!>
server_user nobody
# server_socket /tmp/istat.sock
server_pid /tmp/istat.pid
# cache_dir /var/cache/istat

monitor_net eth0
monitor_disk ( /dev/sda1, /dev/sdb1 )

# End of file
A note about the pid file: You may notice that the config file uses /tmp/istat.pid, instead of the standard /var/run/istat.pid. This is because the istatd processes seems to change users *before* creating the process files instead of after. This prevents the new user from writing to the root-owned /var/run/ directory. I don't know if this is a bug or design, but hopefully we can put this in the proper place in the future.

Once your configuration is done, you can start the service and test connectivity from your iPhone.

$ sudo /sbin/service istatd start

If you want the service to start automatically on every boot, you can enable it with chkconfig.

$ sudo /sbin/chkconfig istatd on

And you're done!