Home  ›  Apple  ›  iOS  ›  Install iStat Server on Red Hat Linux

Tags: , , , ,

Install iStat Server on Red Hat Linux

I recently installed iStat Server (Linux) so I could see my server stats on my iPhone. Very simple app. Works like a charm. I took this information from pukupi.com. I had a very hard time figuring out how to get iStat Linux working and this site helped a lot. Took forever to find though, so I figured I’d post it here for future reference, just in case it disappears.

Bjango iStat for iPhone is a fantastic app for keeping an eye on a Mac server and thanks to the work William Tisater, can monitor Linux, FreeBSD and Solaris servers as well.
I installed iStat server on a server running Red Hat Enterprise Linux 5.3 but these instructions should work with other Red Hat, CentOS and Fedora distros. For Debian and Ubuntu distros, pop over here.

You shouldn’t be logged in as root but let’s give ourselves temporary root permissions for the install:
sudo -i

If you’re a good sys admin and have locked down all unused server ports, open up port 5109 with system-config-securitylevel-tui and adding 5109:tcp to the Customize, Other ports field if planning on using the default iStat port. You’ll also need to install development tools if you haven’t done this already:
1.    yum groupinstall “Development Tools”

Download iStat server
iStat server for Linux, FreeBSD and Solaris is maintained at github and you should pop over there to make sure the latest version corresponds with the wget command below:
1.    wget http://github.com/downloads/tiwilliam/istatd/istatd-0.5.6.tar.gz
2.    tar -zxvf istatd-*.tar.gz
3.    cd istatd-*

Setup iStat server
Configure iStat for your server:
1.    ./configure

If, like me, you get an xml2-config error, install libxml2-dev and run ./configure again:
1.    yum install libxml2-devel
2.    ./configure

Compile and install:
1.    make
2.    make install

Add an istat user and create a directory to store istat.pid:
1.    useradd istat
2.    mkdir /var/run/istat
3.    chown istat /var/run/istat

Tweak the iStat server configuration
Before launching the iStat server, first modify the configuration file for your system:
1.    nano /usr/local/etc/istat.conf

Modify the server_code and anything else to match your system. In my case I also modified monitor_disk:

1.    #
2.    # /etc/istat.conf: Configuration for iStat server
3.    #
5.    # network_addr
6.    # network_port 5109
7.    server_code 12345
8.    # server_user istat
9.    # server_group istat
10.    # server_socket /tmp/istatd.sock
11.    # server_pid /var/run/istat/istatd.pid
12.    # cache_dir /var/cache/istat
14.    # Note: Only support for one network interface, limited by client.
15.    monitor_net ( eth0 )
17.    # Array of disks to monitor. Specify mount path or device name.
18.    # monitor_disk (  /home ) for multiple disks (  /home /dev/hd9 /dev/hd6 )
19.    monitor_disk ( / )
21.    # Set to 1 if you want to use mount path as label instead of the device name.
22.    disk_mount_path_label 0
24.    # Try to probe the filesystem for disk label, will override the mount path label.
25.    disk_filesystem_label 1
27.    # Set custom disk label. Will override all other labels.
28.    # disk_rename_label /dev/sda1 “root”
29.    # disk_rename_label /home “home”
31.    # End of file

Launch iStat server
With the configuration saved, iStat server is ready to launch:
1.    /usr/local/bin/istatd -d

Add your server to iStat for iPhone using the server_code in the iStat server configuration file and start enjoying Bjangolicous server stats.

iStat server running on Red Hat
Launch iStat server at startup
It’s not a bad idea to launch iStat server at startup:
1.    nano /etc/rc.d/rc.local

Add the following to the bottom of /etc/rc.d/rc.local should do the the trick:
1.    /usr/local/bin/istatd -d

You may want to restart your server to confirm iStat server launched OK

Leave a Reply

Let us know if you have a Question, Tip or Trick.