[hobbit] Vmstat data for IRIX systems

Henrik Stoerner henrik at hswn.dk
Fri May 20 16:22:42 CEST 2005


On Fri, May 20, 2005 at 11:46:12AM +0200, Christian Perrier wrote:
> Hobbit currently does not handle vmstat data coming from IRIX systems.
> 
> Indeed, on my former BB install, I hacked the bf-vmstat.sh script a
> little and made it use "sar" to report data to be processed like
> vmstat data from other hosts.
[snip]
> How could I hack hobbit so that it may be able to deal with thisĀ ?

Something like the attached patch should do it (I think it applies to
4.03rc2). It assumes your IRIX hosts have a BBOSTYPE that begins with 
"irix".

I have changed the RRD definition from yours - the "cpu_w" dataset is
normally called "cpu_wait", and I've added a "cpu_csw" dataset because
that will allow you to use the vmstat3 graph definition un-modified.
That means your current vmstat RRD files from IRIX will not be usable 
with Hobbit, as is the case with most of the vmstat RRD's.


Regards,
Henrik

-------------- next part --------------
--- lib/misc.c	2005/03/22 17:54:58	1.31
+++ lib/misc.c	2005/05/20 14:19:38
@@ -53,6 +53,7 @@
 	else if (strcasecmp(osname, "rhel3") == 0)       result = OS_RHEL3;
 	else if (strcasecmp(osname, "snmp") == 0)        result = OS_SNMP;
 	else if (strcasecmp(osname, "snmpnetstat") == 0) result = OS_SNMP;
+	else if (strncasecmp(osname, "irix", 4) == 0)    result = OS_IRIX;
 
 	if (result == OS_UNKNOWN) dprintf("Unknown OS: '%s'\n", osname);
 
--- lib/misc.h	2005/04/30 07:18:11	1.17
+++ lib/misc.h	2005/05/20 14:02:26
@@ -13,7 +13,7 @@
 
 #include <stdio.h>
 
-enum ostype_t { OS_UNKNOWN, OS_SOLARIS, OS_OSF, OS_AIX, OS_HPUX, OS_WIN32, OS_FREEBSD, OS_NETBSD, OS_OPENBSD, OS_LINUX22, OS_LINUX, OS_RHEL3, OS_SNMP } ;
+enum ostype_t { OS_UNKNOWN, OS_SOLARIS, OS_OSF, OS_AIX, OS_HPUX, OS_WIN32, OS_FREEBSD, OS_NETBSD, OS_OPENBSD, OS_LINUX22, OS_LINUX, OS_RHEL3, OS_SNMP, OS_IRIX } ;
 
 extern enum ostype_t get_ostype(char *osname);
 extern int hexvalue(unsigned char c);
--- hobbitd/larrd/do_vmstat.c	2005/05/08 19:35:29	1.15
+++ hobbitd/larrd/do_vmstat.c	2005/05/20 14:13:36
@@ -79,6 +79,17 @@
 	{ -1, NULL }
 };
 
+/* This one for Christian Perrier's hacked IRIX "vmstat" done with sar */
+static vmstat_layout_t vmstat_irix_layout[] = {
+	{ 1, "cpu_usr" },
+	{ 2, "cpu_sys" },
+	{ 3, "cpu_int" },
+	{ 4, "cpu_wait" },
+	{ 5, "cpu_idl" },
+	{ -1, "cpu_csw" },	/* Not available, but having it in the RRD makes vmstat3 graph (int+csw) work */
+	{ -1, NULL }
+};
+
 /* This one matches FreeBSD 4.10 */
 /* LARRD 0.43c compatible */
 static vmstat_layout_t vmstat_freebsd_layout[] = {
@@ -272,6 +283,8 @@
 		layout = vmstat_osf_layout; break;
 	  case OS_AIX: 
 		layout = vmstat_aix_layout; break;
+	  case OS_IRIX:
+		layout = vmstat_irix_layout; break;
 	  case OS_HPUX: 
 		layout = vmstat_hpux_layout; break;
 	  case OS_WIN32:


More information about the Xymon mailing list