Archive for May, 2009

forget about the environment

May 3, 2009

Maybe this is obvious (and still flammable topic) for most of system administrators, but it worth to say it again.

You should never rely on the environment variables, unless you explicitly specify that in the documentation (which is still bad way in most cases). You script must work if there’s no PATH env. variable, or no EDITOR set, etc. Yes, it may say error to the end user in unresolvable conditions, as `svn ci` do if no EDITOR and no -m specified, but generally it shouldn’t fail.

Not `sh`, but `/bin/sh`, not `cat`, but `/bin/cat`! Remember it and you’ll save a lot of nerves for you and all those people that will use your tools.

Thank you.

Advertisements

Even munin have things to simplify

May 3, 2009

The ‘config’ option in munin plugins is probably unnecessary and exists only because somebody didn’t think long enough about it.

No, seriously, I understand why there’s ‘autoconf’ and ‘suggest’ options – they’re really rarely called, maybe on node installation or when module first added to the configuration. But ‘config’ should be (and it is) called before each data fetch. Because graph legend or graph options may change between calls. So, if we always call ‘config’ and ‘fetch’ pair why do we have separate commands for them?

So, it is not an option and should be merged into the ‘fetch’ command.

munin and gaps in df_ graphs

May 2, 2009

Someone forgot to add samba filesystem into the df’s ignore list in FreeBSD port of munin-node. They grep out strings  with “//”  (which is… strange, not to say stupid).

Most of users will have gaps in df munin graphs as the result. Remote filesystem info may be not accessible for dozens of reasons and cause the whole df_ plugin to timeout, which will report “unknown” values to munin and you will get alert email into your inbox and gap in the graph.

To resolve the problem you will need to add smbfs and cifs into the ignore list in two lines of both /usr/local/share/munin/plugins/df_ and df_inode files:

/bin/df -P -t noprocfs,devfs,fdescfs,linprocfs,nfs,smbfs | tail +2 | grep -v “//” | while read i; do

This should be fixed in two lines in each file. You may remove `grep` if you want, I keep it just to be safe.

P.S.: As far as I know the problem exists also in Linux. In the RedHat’s and Ubuntu’s repos at least.