WRITING WEBMINSTATS MODULES

general coding rules

you should also have a look at the Writing Webmin Modules

general module rules


acquisition script : module.pl

Begin with the acquisition script. Do not care about rrdtool : just write a perl script which return the parameter, you want to monitor.
Just a hint : do not use the "die" command.
You can stop here and send me your script if you want : almost all the work is done.

If you want to continue, have a look at other acquisition scripts, such as or load.pl (load module), or users.pl (user module) and copy their behavior: if an operating system need a special acquisition script, you can name it ${module}.pl.${os} (look at netstat module). The module installation will install it before the classic one if os match.

specific coding rules


cgi scripts : module-lib.pl

documentation

you have to first read :

specific coding rules

choose a model

then, you have to choose a model from existing modules :

choose parameter database type

customize in your $(module)-lib.pl install_module or create_base subroutines :
choose your parameter database type (see rrdcreate man page): you have to choose the rra type $(module)-lib.pl general variable :

choose display type

customize in your $(module)-lib.pl graph_data subroutine
choose your parameter display type (see rrdgraph man page): put default colors in defaults.cfg file

module configuration

change mod_config and mod_config_save subroutines

icon

choose an icon, put it in images directory, and change module_icon in module.info file

portability

customize os_support in module.info file to match module portability.
for example module using /proc are restricted to Linux operating systems

translation files

one file by language :

help files

for each module, and for each language : 2 files : the default help (no ${lang} ) is in english

wbmtranslator

a new project wbmtranslator" can help to find missing translations, and missing help files
back to main page
Page changed on 28 january 2011