<!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.2800.1543" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=931171215-03052006><FONT face=Arial color=#0000ff
size=2>Cool. I wrote standalone scripts in similar vein to generate pdf
reports for BS15000/ISO90000 capacity reports. The scripts generate the png
graph files and then incorporates some html files to build the final pdf file
using htmldoc software package (the non-commercial version). In our case,
these are meant to be separate reports and are not linked into the hobbit web
pages.</FONT></SPAN></DIV>
<DIV><SPAN class=931171215-03052006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=931171215-03052006><FONT face=Arial color=#0000ff size=2>One
thing that is a bit vexying is configuring rrdtool commands to insert threshold
lines and tailor the graph legends. The rrdtool command syntax (not hobbit)
changes across releases so if anyone is fooling around in these areas, caveat
emptor. I maintain multiple releases of rrdtool sets and go back and forth
between the versions trying to get particular
features. </FONT></SPAN></DIV>
<DIV><SPAN class=931171215-03052006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN><SPAN class=931171215-03052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=931171215-03052006><FONT face=Arial color=#0000ff
size=2>Generating legends that include not only the minimum and maximum graphed
value, but also the last graphed value. Something that management likes to see.
Also for the disk/filesystem utilization percentages, also including the
allocated disk amount in gigabytes. Getting clean auto-formatting for the
legends is a bear.</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> thomas.seglard.enata@cnp.fr
[mailto:thomas.seglard.enata@cnp.fr]<BR><B>Sent:</B> Tuesday, May 02, 2006
11:21 AM<BR><B>To:</B> hobbit@hswn.dk<BR><B>Subject:</B> [hobbit] PDF
reporting [news] ! First part<BR><BR></FONT></DIV><BR><FONT
size=2><TT>Hello,</TT></FONT> <BR><BR><FONT size=2><TT>I got very good
feedbacks on the reports. Thank you for these ! </TT></FONT><BR><FONT
size=2><TT>Now, I'm going to explain how it works. You got two parts. On one
hand, some shell scripts will generate the rrd graphs and save them as PNG. In
other hand, a php page will do the reports with the (GREAT) help of the
libfpdf. </TT></FONT><BR><BR><FONT size=2><TT>Before I go further, I want to
say that I created a directory called 'pdf' into @HOBBITSERVERHOME/www/ In
addition, I make an 'images', 'graphrrd', 'export' directories. In conclusion,
I got the 'pdf' directory organized like this :</TT></FONT> <BR><BR><FONT
size=2><TT>[hobbit@psi200 pdf]$ ls -al</TT></FONT> <BR><FONT size=2><TT>total
164</TT></FONT> <BR><FONT size=2><TT>drwxr-xr-x 6 hobbit hobbit
4096 mai 2 14:52 .</TT></FONT> <BR><FONT size=2><TT>drwxr-xr-x
30 hobbit hobbit 4096 mai 2 15:25 ..</TT></FONT> <BR><FONT
size=2><TT>drwxr-xr-x 5 hobbit hobbit 4096 avr 30 23:59
export</TT></FONT> <BR><FONT size=2><TT>drwxrwxr-x 157 hobbit hobbit
4096 avr 28 19:20 graphrrd</TT></FONT> <BR><FONT size=2><TT>drwxrwxr-x
2 hobbit hobbit 4096 mar 22 18:31 images</TT></FONT>
<BR><FONT size=2><TT>-rwxrwxr-x 1 hobbit hobbit 5251 mar 22
15:52 pdf.php</TT></FONT> <BR><FONT size=2><TT>-rwxrwxr-x 1
hobbit hobbit 52241 avr 21 19:53 rapport.php</TT></FONT> <BR><FONT
size=2><TT>-rwxrwxr-x 1 hobbit hobbit 11125 avr 11 16:17
rapportredac.php</TT></FONT> <BR><FONT size=2><TT>-rwxrwxr-x 1
hobbit hobbit 7459 avr 10 15:31 rapports_annuels.php</TT></FONT>
<BR><FONT size=2><TT>-rwxrwxr-x 1 hobbit hobbit 8814 avr 10
15:30 rapports_mensuels.php</TT></FONT> <BR><FONT size=2><TT>drwxrwxr-x
2 hobbit hobbit 4096 mai 2 12:34 scripts</TT></FONT>
<BR><BR><FONT size=2><TT>export : directory where all reports generated
automatically go.</TT></FONT> <BR><FONT size=2><TT>graphrrd : directory where
all PNG graphs generated automatically go.</TT></FONT> <BR><FONT
size=2><TT>images : directory where all images to include in the pdf go. I'm
giving you some images in images.zip</TT></FONT> <BR><FONT size=2><TT>scripts
: directory to stock scripts which generate the PNG graphs.</TT></FONT>
<BR><BR><BR><FONT size=2><TT>Ok, let's go !</TT></FONT> <BR><FONT
size=2><TT>1) first part : shell scripts (rrdscripts.zip). Decompress the
scripts into your 'pdf' directory and edit them to modify the destination of
PNGs graphs. Once done, launch master.sh and look at the results. For one
server, you must have 4 graphs BY test. Actually, I'm graphing 6 tests -
cputil, load, memory, iowait, network (don't work for linux at the moment !!)
and run-queue. You can add more tests if you want ! For example, you will have
: </TT></FONT><BR><BR><FONT size=2><TT>graphrrd/myserver/</TT></FONT>
<BR><FONT size=2><TT>load.myserver-[day/week/month/year].png</TT></FONT>
<BR><FONT size=2><TT>mem.myserver-[day/week/month/year].png</TT></FONT>
<BR><FONT size=2><TT>...</TT></FONT> <BR><BR><FONT size=2><TT>Now, you can do
a cron to launch master.sh every hour to update your graphs.
</TT></FONT><BR><FONT size=2><TT>Thanks to ED (ed.zehome.com) for his site and
his explanation of rrdtool. I used examples from his site into the
scripts...</TT></FONT> <BR><BR><FONT size=2><TT>2) Second part, the php pages
(pdfreports.zip). Put these files directly into the pdf directory. You have
five files :</TT></FONT> <BR><BR><FONT size=2><TT>- pdf.php --> contains
the main form with hobbit's look ! You may add this page to your hobbit's
menu. Simply type in the text field a server name and got your *beautiful*
report :)</TT></FONT> <BR><FONT size=2><TT>- rapport.php --> contains all
the php code. So, the file pdf.php calls this file when a name is submitted.
Within this script you can define </TT></FONT><BR><BR><FONT size=2><TT>-
rapportredac.php --> contains a form with several textareas. You have to
put a server name, check a box if the server is overloaded, underloaded or
'normally loaded'. Then, all text in the textareas will go under graphs in the
pdf report. You can easily build analysis for your boss or team... Like
pdf.php, this page calls rapport.php.</TT></FONT> <BR><BR><FONT size=2><TT>-
rapports_mensuels (monthly) and rapports_annuels (annual - sorry for french) :
you can execute these scripts to have reports - for all servers -
automatically generated and put into a directory. Like 'master.sh' you can do
a cron to have reports each end of month. These two scripts even check the
last day of month and send a mail when reports are generated.
</TT></FONT><BR><BR><FONT size=2><TT>If all is correct you will have a pdf
report with your graphs in it when you click on 'rapport !' on the pdf.php
page. That's all !</TT></FONT> <BR><FONT size=2><TT>You have to edit them by
hand to modify and adapt to your configuration. I'm sorry the code isn't very
clean at all ! Moreover, you will have a lot of french text in the files. I'm
beginning to rewrite comments into english.</TT></FONT> <BR><FONT
size=2><TT>Feel free to make comments and/or modifications to the scripts.
</TT></FONT><BR><BR><FONT size=2><TT>I hope, these reports will satisfy your
needs. I'm sorry for the shorts explanations but I got another project which
take all my time... So, I will try my best to answer questions, if you have
some !</TT></FONT> <BR><FONT size=2><TT>Best regards,</TT></FONT>
<BR><BR><FONT size=2><TT>Thomas Seglard</TT></FONT> <BR><BR><FONT
size=3><BR><BR>Ce message (et toutes ses pieces jointes eventuelles) est
confidentiel et etabli a l'intention exclusive de ses destinataires.<BR>Toute
utilisation de ce message non conforme a sa destination, toute diffusion ou
toute publication, totale ou partielle, est<BR>interdite, sauf autorisation
expresse.<BR>L'internet ne permettant pas d'assurer l'integrite de ce message,
CNP Assurances et ses filiales declinent toute responsabilite<BR>au titre de
ce message, s'il a ete altere, deforme ou falsifie.<BR><BR>*****<BR><BR>This
message and any attachments (the "message") are confidential and intended
solely for the addressees.<BR>Any unauthorised use or dissemination is
prohibited.<BR>E-mails are susceptible to alteration.<BR>Neither CNP
Assurances nor any of its subsidiaries or affiliates shall be liable for the
message if altered, changed or falsified.<BR></BLOCKQUOTE></FONT></BODY></HTML>