Monitoring OpenSolaris from an iTouch

The idea:

I just acquired an Apple iTouch, and discovered an interesting application called iStat, which allows to show basic iTouch/iPhone infos, remote display iStat Menu info of a Mac, and, this is the more interesting part, do the same remote display from other OS by running an OpenSourced daemon on your favorite OS.

(Open)Solaris:

For Linux, BSD and Solaris, only the source code is provided. So you have to compile it by yourself with Gcc. The Gcc environment is available from the /release of /dev IPS server. I recommend to compile on the latest build (like b134). The standard procedure for Linux is documented in the README file. For OpenSolaris,  this can be done in three steps.

Thanks to Mo McRoberts who helped in porting the SW to BSD/Solaris, and helped me to compile:

1) Get the compiler environment, in one single command:

pfexec pkg install SUNWgcc SUNWaconf SUNWgnu-automake-110 SUNWlibtool

2) Set some required variables for the previous packages

ACLOCAL110=aclocal-1.10
export ACLOCAL110
AUTOMAKE110=automake-1.10
export AUTOMAKE110
AUTOCONF26=autoconf
export AUTOCONF26
AUTOHEADER26=autoheader
export AUTOHEADER26
LIBTOOLIZE15=libtoolize
export LIBTOOLIZE15
  

3) Configure and compile with the two commands:

 ./configure

and

make

 

How it works

After the make, you should find a binary istatd, and a configuration file istat.conf. Configuration is also done in 3 steps:

1) The binary needs the istatd user and group that can be added as following:

pfexec useradd istat; pfexec groupadd istat

2) Give access to the istat user to the  /var/cache/istat directory:

pfexec chown istat:istat /var/cache/istat/

3) Edit istat.conf to set the correct NIC interface name, and change the server code which is a simple 5 digit number that has to be entered on on iPhone/iTouch as a basic check-in. Move this file to /usr/local/etc

pfexec cp istat.conf /usr/local/etc

And now, fire it up (-h for help):

pfexec ./istatd -d

You'll then be able to connect from your  iTouch/iPhone if wifi is giving you connectivity to your OSOL box, by specifying its IP address. Other possible arguments for the binary can be displayed with the -h argument.

Which infos

Well, basic but enough for me, like:

  • system updatime
  • system load
  • CPU usage
  • memory usage status (cached/active and free)
  • Pages In and Pages Out
  • Swap size
  • network traffic (for inly one interface, due to client limitation on the iPhone/iTouch)
  • disk usage (on Solaris 10 only, might be a bug)

It's not for production yet, it's not secured, but it gives you basic info of your OSOL box without having to connect to a desktop/laptop. It even runs on Solaris 10/x86 systems (still not for production).

Good to know

The iTouch application also provide you a ping and a traceroute function to help you debug any subnet or IP address error. 

So, here is what we have (here average CPU infos on two cores):

Monitoring OpenSolaris from an iPod/iTouch

And the same info on OpenSolaris with the Gnome "System Monitor" tool:

Monitor OpenSolaris with teh Gnone "System Monitor" tool.

What next ?

 Well, this is just an idea: we do have a nice Sun Storage portfolio, based on the OpenSolaris kernel, showing some nice graphics with the web based Analytics tool. I was wondering is such graphical informations, as shown on Mika's blog, can be also accessed from an iPod/iTouch/iPad, as this CRM application does on an iPad.


Comments:

Hi Karim,
very cool idea! Works nearly out of the box. Only the package SUNWgnu-automake-110 was misspelled and it's "make" not "./make". Sorry for being so nerdy ;-)
Thanks
Mike

Posted by Michael Zimmer on April 22, 2010 at 07:13 PM CEST #

and what is with Windows Mobile?

Posted by MArlon on April 23, 2010 at 02:40 AM CEST #

Hi Mike,

Good catch !! I included your corrections. Thanks for taking the time to test it ;)

Karim

Posted by Karim on April 23, 2010 at 03:56 AM CEST #

Regarding Windows Mobile, well I don't own any Windows Mobile device, so I didn't investigate on this mobile client. Even iStat Server have not been ported to monitor Windows servers as decribed in http://bjango.com/help/istat/istatserverwindows/

Karim

Posted by Karim on April 23, 2010 at 04:04 AM CEST #

A am a novice at opensolaris and am not sure how to complete step 2 & 3 - I have completed step 1.

Thanks in advance

Posted by Eric on June 27, 2010 at 02:06 PM CEST #

Eric,
for step two:
\* open a terminal (right click on your desktop and choose "Open Termianl)
\* ensure that you are in the directory where you have compiled it.
\* type in "pfexec chown istat:istat /var/cache/istat/"

for step three:
a) in the same terminal window, type in "ifconfig -a"
b) look for the NIC name that has a valid IP address, something like nge0:
c) type in "pfexec gedit istat.conf"
d) edit the interface name with one you got with step b)
e) save it
f) copy this file with "pfexec cp istat.conf /usr/local/etc "
g) launch the server with "pfexec ./istatd -d "

HTH

Posted by Karim Berrah on June 28, 2010 at 03:15 AM CEST #

I am still having issues

\*open a terminal (right click on your desktop and choose "Open Termianl)
\* ensure that you are in the directory where you have compiled it.
--ABOVE DONE NO ISSUES

\* type in "pfexec chown istat:istat /var/cache/istat/"
-- I GET chown: cannot access `/var/cache/istat/': No such file or directory
-- I have also checked and there is no istat directory under cache

\* in the same terminal window, type in "ifconfig -a"
-- MY INTERFACE NAME IS RGE0

\* type in "pfexec gedit istat.conf"
-- FILE DOES NOT EXIST AND BY RUNING A NANO I CREATE THE FILE WITH RGE0 only? I AM NOT SURE ABOUT THIS????

\* copy this file with "pfexec cp istat.conf /usr/local/etc "
--DONE

\* launch the server with "pfexec ./istatd -d "
\* I GET Could not read configuration from /usr/local/etc/istat.conf: Not a directory

Thanks in advance and I hope I can get this app working soon

Posted by Eric on July 06, 2010 at 05:37 PM CEST #

On some Sun's machines istatd don't recognized network cards, needs little modification in kstat.c

Posted by Alexander on July 07, 2010 at 05:44 AM CEST #

Alexander / Berrah can you help me get to the bottom of the issue?

Posted by Eric on July 07, 2010 at 09:55 AM CEST #

For igb on my SunFire X2270 this quick diff in kstat.c:
< if(NULL == (ksp = kstat_lookup(ksh, NULL, -1, _dev))) return -1;
---
> if(NULL == (ksp = kstat_lookup(ksh, module, -1, name))) return -1;

Also tried on T1000, crashed with "bus error" - need some investigation here..

Posted by Alexander on July 07, 2010 at 11:47 AM CEST #

Eric, check /usr/local/etc/istat.conf , may be
you haven't this directory?

Posted by Alexander on July 07, 2010 at 12:55 PM CEST #

Who cares receive data from istatd - http://alexeremin.blogspot.com/2010/07/sample-client-for-istatd.html

Posted by Alexander on July 13, 2010 at 04:12 AM CEST #

Who cares receive data from istatd, I've written an example client (see my blog).

Posted by Alexander on July 13, 2010 at 04:15 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessary reflect the views of Oracle. English Fran├žais

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today