Vmstat data for IRIX systems
list Christian Perrier
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.
The bf-vmstat.sh script I use is:
#!/bin/sh
# $Id: vmstat-bf.sh,v 1.1 2000/11/30 20:29:44 scott Exp $
# vmstat-bf.sh
# variable definitions
MET=vmstat
VMSTAT=/usr/bin/sar
OUT=$BBHOME/tmp/$MET.$$
#################
# COLLECT
#################
# vmstat
echo "$BBOSTYPE" > $OUT
# get the data
$VMSTAT 300 2 | $TAIL -1 >> $OUT
##################
# REPORT
##################
if [ $LARRDCOMM = DATA ]
then
$BB $BBDISP "data ${MACHINE}.$MET
`$CAT $OUT`"
else
$BB $BBDISP "status ${MACHINE}.$MET green `date` <$MET>
`$CAT $OUT`"
fi
rm $OUT
/usr/bin/sar xx 2 output looks like that:
bb at rhea:~/ext/bf-larrd> /usr/bin/sar 10 2
IRIX64 rhea 6.5 10070055 IP27 05/20/05
11:44:00 %usr %sys %intr %wio %idle %sbrk %wfs %wswp %wphy %wgsw %wfif
11:44:10 51 2 0 0 47 0 100 0 0 0 0
11:44:20 52 3 0 0 45 0 0 0 0 0 0
Average 52 2 0 0 46 0 167 0 0 0 0
The vmstat-larrd.pl entry I use is:
irix => { cpu_usr => 1,
cpu_sys => 2,
cpu_int => 3,
cpu_w => 4,
cpu_idl => 5,
},
How could I hack hobbit so that it may be able to deal with this ?
PS : I have similar hacks for the Super-UX OS run by NEC
supercomputers (I run BB clients on both of these)
--
list Henrik Størner
▸
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:
list Christian Perrier
▸
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".
Yes, that's it. Indeed I never bothered trying to find whether vmstat
could be used on IRIX..:-)
I'll probably wait for official releases...if you plan to include this
(not sure as this may be considered somewhat specific to my setup).
In fact, I have decided to stay with official Hobbit releases on the
server, now...and just use the Debian packages you provide (and, yes,
I remember I said I would look at it...:-)).
list Henrik Størner
▸
On Fri, May 20, 2005 at 05:47:18PM +0200, Christian Perrier wrote:
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".Yes, that's it. Indeed I never bothered trying to find whether vmstat could be used on IRIX..:-) I'll probably wait for official releases...if you plan to include this (not sure as this may be considered somewhat specific to my setup).
I've included it in 4.0.3, but with a warning that it may change. If vmstat does work on IRIX, I'd prefer to use those data since they are probably a bit more detailed than what you get from sar. It would also be nice if you could show me what the "netstat -s" output looks like - then Hobbit would be able to track these data as well for IRIX.
▸
In fact, I have decided to stay with official Hobbit releases on the server, now...and just use the Debian packages you provide (and, yes, I remember I said I would look at it...:-)).
I know how you feel ... Regards, Henrik