A paper star…
various kinds of cables as festoons…
a penguin…
a memorabilia CD…
an Opera red ball…
…and some other geeky stuff
Merry Christmas, fellow sysadmins!!!
A paper star…
various kinds of cables as festoons…
a penguin…
a memorabilia CD…
an Opera red ball…
…and some other geeky stuff
Merry Christmas, fellow sysadmins!!!
I did some changes to the makefile I published last month. It would be too much to completely rewrite the blog post to adapt for the changes, so I am just publishing the update here, and you can do the diff yourself.
There is still a lot of factorization left to do, I am leaving it to when I'll have more time. If, in the meanwhile, you come up with a better version, please leave a comment here.
I still have problems with LVS metrics, in particular: "LVS traffic in" is not getting any data. If you can spot the mistake and tell me, that would be much appreciated.
Have fun! … Continue reading
Still fiddling with RRD, and I'm about at the end of the tunnel 🙂 I finally collected a significant amount of data, and I have scripts to aggregate different sources. What I was missing was a quick way to generate graphs, so that I could visually check if my aggregated data "looks" OK.
As usual, the syntax of rrdtool graph is quite verbose and cryptic, not exactly what you hope when all you need is a quick one-shot graph of some RRD files.
As always, Perl comes to the rescue, this time with RRD::Simple. RRD::Simple is by default able to generate nice graphs with pre-loaded color schemes –if you suck at choosing colors like me, this is a really appreciable feature. It has a set of pre-defined graphs that it can generate, as well, but since it accepts native RRD options (beside its own set), it's actually easy to bend it at your need, and generating a graph just needs a one-liner:
perl -MRRD::Simple -e 'RRD::Simple->graph("aggr_root_storage.rrd", destination => "/tmp", sources => [ qw{perc_used worst_perc_free} ], width => 1024, height => 768, start => 1288566000, end => 1291158000, periods => [ "daily" ] )'
Or, reindented:
perl -MRRD::Simple -e
'RRD::Simple->graph("aggr_root_storage.rrd",
destination => "/tmp",
sources => [ qw{perc_used worst_perc_free} ],
width => 1024, height => 768,
start => 1288566000, end => 1291158000,
periods => [ "daily" ] )'
The periods options, in this case, has no purpose but to generate only one graph (otherwise you would get many graphs, all equal; why? go and find out yourself, if you really care 😉
And what about plotting a collection of RRDs? It could be something like:
$ for FILE in aggr*.rrd ; do export FILE ; perl -MRRD::Simple -e 'RRD::Simple->graph($ENV{FILE}, destination => "/tmp", width => 1024, height => 768, start => 1288566000, end => 1291158000, periods => [ "daily" ] )' ; done
or, clearer:
$ for FILE in aggr*.rrd ;
do
export FILE ;
perl -MRRD::Simple -e
'RRD::Simple->graph($ENV{FILE},
destination => "/tmp",
width => 1024, height => 768,
start => 1288566000, end => 1291158000,
periods => [ "daily" ] )' ;
done
…or at least: you think it doesn't 🙂 That's what happened to me.
I had an RRD file with a number of RRAs and different resolutions. The following is a snippet of rrdtool info with the non relevant stuff left out. … Continue reading
Reading in one of the blogs I keep an eye on (I didn't say I read it thorougly all the time, I just keep an eye on it) I stumbled upon the acronym THINK. It refers to five qualities that what you write should always have, especially when you're communicating with other people.
Each time you are writing, or at least before you rush to the "Send" button in your MTA, you should consider if what you have just written is:
Thoughtful
Honest
Intelligent
Necessary
Kind
I admit I sometimes sin with T and N, and in the worst case with K 😦
In my previous post about AppConfig I suggested an approach in order to read configuration options from a file, and override them with command-line options. It turns out that it works pretty well in the most common case (that is: only scalar variables are involved), but works really bad when list variables come into play.
The problem lies in the command line parsing happening two times, so while scalar variables are overwritten with the same value they had at the first pass, the list variables add the specified value again. Probably, not what you want. The fix is actually trivial:
# Reading configuration
# The first AppConfig object, we'll throw it away. We'll use it
# just to discover if there is a config file that we should read
# first, and then override config file options on the command line
my $config_file ;
{
my $c = AppConfig->new($ACparms,@config_vars) ;
my $args = [ @ARGV ] ;
$c->args($args) ;
$config_file = $c->get("config") ;
}
my $c = AppConfig->new($ACparms,@config_vars) ;
if (defined $config_file) {
$c->file($config_file) ;
}
$c->args() ;
So basically, we parse the command line the first time inside a bare block, and just to find out if the config option was specified; that option will tell us if we have to parse a configuration file. Once the bare block is over, the AppConfig object ceases to exist, so when we get to the command line again, we are starting from scratch: no duplicated list values any more 🙂
I often have to go back to CUPS documentation. I don't use the command line tools nowadays, so I manage to forget the command line options from one time to another. That's enough to write a blog post about that, in order to have a short note to refer to 🙂
Printing in landscape mode is:lpr -o landscape filename
How many sides?lpr -o sides=one-sided filename is one sidedlpr -o sides=two-sided-short-edge filename is two sides, flipping along the short edge of the pagelpr -o sides=two-sided-long-edge filename is two sides, flipping along the long edge of the page
Printing N pages per page (n-up or number-up printing) is:lpr -o number-up=N filename
Page fitting is:lpr -o fit-to-page filename
Pretty-printing:lpr -o prettyprint filename
This one is especially useful for those that use C/C++ but, unfortunately, of limited use for those who use Perl. XEmacs' prettyprinting is very good for that, by the way.
Print N copies:lpr -#N filename
This is a short HOWTO for the AppConfig module. It assumes some knowledge of how to use Perl modules.
What it is
AppConfig is a Perl module that allows you to manage a program’s configuration in a simple way, with both configuration files and command line options.
AppConfig configurations support scalar variables, arrays and hashes, which naturally translate into Perl variables.
Quanto segue è la traduzione in Italiano di quanto compare in coda alla home page del progetto OpenSSH. Secondo me è un'informazione che merita di essere conosciuta e diffusa. Il grassetto nel testo l'ho aggiunto io.
Cortesemente date un'occhiata lla nostra pagina chi usa OpenSSH, che elenca solo alcune delle aziende che utilizzano OpenSSH nei loro prodotti — come funzionalità di accesso e sicurezza di importanza cruciale — anziché scrivere la loro implementazione di SSH o comprarne una da un'altra azienda. Questa lista include in particolare società come Cisco, Juniper, Apple, Red Hat e Novell; ma probabilmente include più o meno qualasiasi router, switch o sistema operativo Unix-like. Nei dieci anni passati dall'inizio del progetto OpenSSH queste società non hanno contribuito neanche un centesimo a supporto del progetto (nonostante numerose richieste).

There is a note at the bottom of the OpenSSH project home page that well deserves to be said and spread (stress over paragraphs is mine):
Please take note of our Who uses it page, which list just some of the vendors who incorporate OpenSSH into their own products — as a critically important security / access feature — instead of writing their own SSH implementation or purchasing one from another vendor. This list specifically includes companies like Cisco, Juniper, Apple, Red Hat, and Novell; but probably includes almost all router, switch or unix-like operating system vendors. In the 10 years since the inception of the OpenSSH project, these companies have contributed not even a dime of thanks in support of the OpenSSH project (despite numerous requests).