<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" text=#000000
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>Switch the subject to better reflect the topic and
</FONT><FONT face=Arial size=2>I move the script in development up here, it
should be version 0.1 not 1.0. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><A
title="http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/sandbox/modules/os-count-1.0/
CTRL + Click to follow link"
href="http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/sandbox/modules/os-count-1.0/">http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/sandbox/modules/os-count-1.0/</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I was able raise red flag if osversion is RH9.
need to continue the work further to my goal.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>tj</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:michael.nemeth@lmco.com
CTRL + Click to follow link"
href="mailto:michael.nemeth@lmco.com">michael nemeth</A> </DIV>
<DIV><B>Sent:</B> Thursday, November 13, 2008 4:50 AM</DIV>
<DIV><B>To:</B> <A title="mailto:hobbit@hswn.dk
CTRL + Click to follow link"
href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</A> </DIV>
<DIV><B>Subject:</B> Re: [hobbit] [Hobbit/Xymon] PDF Reports</DIV></DIV></DIV>
<DIV><BR></DIV>I Did a little work on this yesterday. You have to parse the info
section and look for the string "OS:" gabbing that line<BR>for further
processing. BUT I think Ive an easy way to do what you want, will look
into it today!<BR><BR>T.J. Yang wrote:
<BLOCKQUOTE cite=mid:BAY138-W15C57FFF741F29336F6CAE9F140@phx.gbl type="cite">
<STYLE>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</STYLE>
Thanks for sharing the code of your modification.<BR>I will need to parse
"uname -a" section and have a hash or array to keep counting of
os appearance... etc.<BR> <BR>later<BR><BR><BR>T.J.
Yang<BR><BR><BR><BR>> Date: Wed, 12 Nov 2008 07:34:06 -0500<BR>> From:
<A class=moz-txt-link-abbreviated
href="mailto:michael.nemeth@lmco.com">michael.nemeth@lmco.com</A><BR>> To:
<A class=moz-txt-link-abbreviated
href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</A><BR>> Subject: Re: [hobbit]
[Hobbit/Xymon] PDF Reports<BR>> <BR>> |I have a pet project to write a
oscount hobbit server side module by <BR>> modifying<BR>> |Henrik's
rootlogin perl script. The script is to display statistics of <BR>> OS
types and their verions.<BR>> Maybe this will help you with your
project<BR>> This is what to "parse " ps output on the server side to chech
for <BR>> running back-up (save -s).<BR>> Watch out for line
wraps<BR>> #!/usr/local/bin/perl<BR>> <BR>>
#*----------------------------------------------------------------------------*/<BR>>
#* Hobbit client message <BR>> processor. */<BR>> #* <BR>> */<BR>>
#* This perl program shows how to create a server-side module using <BR>>
the */<BR>> #* data sent by the Hobbit clients. This program is fed data
from <BR>> the */<BR>> #* Hobbit "client" channel via the
hobbitd_channel program; each <BR>> client */<BR>> #* message is
processed by looking at the [who] section and <BR>> generates */<BR>> #*
a "login" status that goes red when an active "root" login is <BR>> found.
*/<BR>> #* <BR>> */<BR>> #* Written 2007-Jan-28 by Henrik Storner
<BR>> <A class=moz-txt-link-rfc2396E
href="mailto:henrik@hswn.dk"><henrik@hswn.dk></A> */<BR>> #* <BR>>
*/<BR>> #* This program is in the public domain, and may be used freely
<BR>> for */<BR>> #* creating your own Hobbit server-side <BR>>
modules. */<BR>> #* Henrik's script was modified by me, Mike Nemeth
<BR>> <A class=moz-txt-link-abbreviated
href="mailto:Michael.nemeth@lmco.com">Michael.nemeth@lmco.com</A> */<BR>>
#* the rootlogin.pl which parses the [who] section was changed to <BR>>
parse */<BR>> #* the [ps] of client <BR>> data. */<BR>> #* Often Ive
seen people ask how to monitor a certain proccess and <BR>> have */<BR>>
#* a separted test/column for it This works for <BR>> me! */<BR>> #*
<BR>> */<BR>>
#*----------------------------------------------------------------------------*/<BR>>
<BR>> # $Id: rootlogin.pl,v 1.1 2007/01/28 12:42:34 henrik Exp $<BR>> #
look for back-ups running: save -s<BR>> <BR>> my $bb;<BR>> my
$bbdisp;<BR>> my $hobbitcolumn = "bkup";<BR>> my $hostname = "";<BR>>
my $msgtxt = "";<BR>> my %sections = ();<BR>> my $cursection =
"";<BR>> <BR>> sub processmessage;<BR>> <BR>> <BR>> # Get the
BB and BBDISP environment settings.<BR>> $bb = $ENV{"BB"} || die "BB not
defined";<BR>> $bbdisp = $ENV{"BBDISP"} || die "BBDISP not
defined";<BR>> <BR>> <BR>> # Main routine.<BR>> #<BR>> # This
reads client messages from <STDIN>, looking for the<BR>> # delimiters
that separate each message, and also looking for the<BR>> # section markers
that delimit each part of the client message.<BR>> # When a message is
complete, the processmessage() subroutine<BR>> # is invoked. $msgtxt
contains the complete message, and the<BR>> # %sections hash contains the
individual sections of the client<BR>> # message.<BR>> <BR>> while
($line = <STDIN>) {<BR>> if ($line =~ /^\@\@client\#/) {<BR>> #
It's the start of a new client message - the header <BR>> looks like
this:<BR>> # <BR>>
@@client#830759/HOSTNAME|1169985951.340108|10.60.65.152|HOSTNAME|sunos|sunos<BR>>
<BR>> # Grab the hostname field from the header<BR>> @hdrfields =
split(/\|/, $line);<BR>> $hostname = $hdrfields[3];<BR>> <BR>> #
Clear the variables we use to store the message in<BR>> $msgtxt =
"";<BR>> %sections = ();<BR>> }<BR>> elsif ($line =~ /^\@\@/)
{<BR>> # End of a message. Do something with it.<BR>>
processmessage();<BR>> }<BR>> elsif ($line =~ /^\[(.+)\]/) {<BR>> #
Start of new message section.<BR>> <BR>> $cursection = $1;<BR>>
$sections{ $cursection } = "\n";<BR>> }<BR>> else {<BR>> # Add
another line to the entire message text variable,<BR>> # and the the
current section.<BR>> $msgtxt = $msgtxt . $line;<BR>> $sections{
$cursection } = $sections{ $cursection } . $line;<BR>> }<BR>> }<BR>>
<BR>> <BR>> # This subroutine processes the client message. In this
case,<BR>> # we watch the [ps] section of the client message and
alert<BR>> # if our string is found: save -s meaning backs are
active.<BR>> <BR>> <BR>> sub processmessage {<BR>> my
$color;<BR>> my $summary;<BR>> my $statusmsg;<BR>> my $cmd;<BR>>
my $cmdl;<BR>> <BR>> # Dont do anything unless we have the "ps"
section<BR>> return unless ( $sections{"ps"} );<BR>> <BR>> # Is the
string/process somewhere in the "ps" section?<BR>> # Note that we must
match with /m because there are multiple<BR>> # lines in the [ps]
section.<BR>> if ( ($cmdl) = $sections{"ps"} =~ /(save.+-s.*)/ ) {<BR>>
$color = "yellow";<BR>> $summary = "There MAYBE active backups" ;<BR>> #
$statusmsg = "&yellow " . $cmdl . $sections{"ps"};<BR>> # sendins out
the entire ps section seam to cause some purples so just <BR>> send the
match `, hey you've a proc column all ready.<BR>> $statusmsg = "&yellow
" . $cmdl ;<BR>> }<BR>> else {<BR>> $color = "green";<BR>>
$summary = "Ok";<BR>> $statusmsg = "&green No backup
active\n\n";<BR>> }<BR>> # Build the command we use to send a status to
the Hobbit daemon<BR>> $cmd = $bb . " " . $bbdisp . " \"status " .
$hostname . "." . <BR>> $hobbitcolumn . " " . $color . " " . $summary .
"\n\n"<BR>> . $statusmsg . "\"";<BR>> # And send the message<BR>>
system $cmd;<BR>> }<BR>> <BR>> <BR>> <BR>> <BR>> T.J. Yang
wrote:<BR>> ><BR>> ><BR>> >
--------------------------------------------------<BR>> > From: "Martin
Flemming" <A class=moz-txt-link-rfc2396E
href="mailto:martin.flemming@desy.de"><martin.flemming@desy.de></A><BR>>
> Sent: Wednesday, November 12, 2008 4:14 AM<BR>> > To: <A
class=moz-txt-link-rfc2396E
href="mailto:hobbit@hswn.dk"><hobbit@hswn.dk></A><BR>> > Subject:
Re: [hobbit] [Hobbit/Xymon] PDF Reports<BR>> ><BR>> >><BR>>
>> Hi, Thomas ..<BR>> >><BR>> >> i'm very interesting
and other too, i think :-)<BR>> ><BR>> > Second that.<BR>> >
you can post your script here, I will upload the script to svn <BR>> >
repository.<BR>> ><BR>> > Or request an account from Henrik and
upload the script yourself.<BR>> ><BR>> > I have a pet project to
write a oscount hobbit server side module by <BR>> > modifying<BR>>
> Henrik's rootlogin perl script. The script is to display statistics of
<BR>> > OS types and their verions.<BR>> > This is useful for
management to understand how many Solaris 2.5.1, <BR>> > 2.6 are still
hanging around<BR>> > in a big IT environment.<BR>> ><BR>>
><BR>> > tj<BR>> ><BR>> >> .. the shire will be the
right place ..<BR>> >><BR>> >> cheers,<BR>> >>
martin<BR>> >><BR>> >> On Wed, 12 Nov 2008, Thomas Séglard
wrote:<BR>> >><BR>> >>> Hello,<BR>>
>>><BR>> >>> some months (year ?) ago, I wrote a few
php/shell code lines to <BR>> >>> generate<BR>> >>>
on-demand/automatised PDF reports with the help of the RRD data <BR>>
>>> produced by<BR>> >>> Hobbit. At the time of coding,
I've used 'libfpdf' but it's a pain <BR>> >>> to include<BR>>
>>> PNG with alpha-channel.<BR>> >>><BR>> >>>
I'm now in charge of a new platform and I setup Hobbit to monitor <BR>>
>>> everything,<BR>> >>> of course :) Besides, I
discovered the library 'tcpdf' which is very <BR>> >>> good
and<BR>> >>> efficient. So, I decided to bring back my reports and
have them to <BR>> >>> work with<BR>> >>> 'tcpdf'.
Modifications were easy since 'tcpdf' is based on 'libfpdf' <BR>>
>>> and now<BR>> >>> everything works again :) But this
time, I really want to share this <BR>> >>> work<BR>>
>>> with you on the Shire or whatever. I need to know if some of you
are<BR>> >>> interested by these reports... Thus, just let me
know.<BR>> >>><BR>> >>> Best regards,<BR>>
>>><BR>> >>> ThomaS<BR>> >>><BR>>
>>> To unsubscribe from the hobbit list, send an e-mail to<BR>>
>>> <A class=moz-txt-link-abbreviated
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR>>
>>><BR>> >>><BR>> >>><BR>>
>>><BR>> >><BR>> ><BR>> ><BR>> ><BR>>
>> To unsubscribe from the hobbit list, send an e-mail to<BR>>
>> <A class=moz-txt-link-abbreviated
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR>>
>><BR>> ><BR>> > To unsubscribe from the hobbit list, send
an e-mail to<BR>> > <A class=moz-txt-link-abbreviated
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR>>
><BR>> ><BR>> ><BR>> <BR>> <BR>> To unsubscribe from
the hobbit list, send an e-mail to<BR>> <A class=moz-txt-link-abbreviated
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR>>
<BR>> <BR><BR><BR>
<HR>
Windows Live Hotmail now works up to 70% faster. <A
href="http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008"
target=_new moz-do-not-send="true">Sign up
today.</A></BLOCKQUOTE><BR></BODY></HTML>