| 1 | 1 | simandl | The script "read-data.pl" is quite small. It just imports the HotSaNICmod.pm library and calls its init function. |
| 2 | | | Everything else happens then in HotSaNICmod::init. |
| 3 | | | |
| 4 | | | ---------- BEGIN CODE ---------- |
| 5 | | | #!/usr/bin/env perl |
| 6 | | | use warnings; |
| 7 | | | use diagnostics; |
| 8 | | | |
| 9 | | | $|=1; |
| 10 | | | |
| 11 | | | use lib "../../lib"; |
| 12 | | | use HotSaNICmod; |
| 13 | | | |
| 14 | | | HotSaNICmod::init(@ARGV); |
| 15 | | | ---------- END CODE ---------- |
| 16 | | | |
| 17 | | | |
| 18 | | | The init() function will now import the module's "common.pm" library, parse the settings file and check the commandline arguments that have been passed to the script and act accordingly. |
| 19 | | | Currently the following parameters are accepted: |
| 20 | | | |
| 21 | | | argument function |
| 22 | | | --------- -------------------------------------------------- |
| 23 | | | start start module daemon |
| 24 | | | stop terminate module daemon |
| 25 | | | status show status of module daemon |
| 26 | | | configure running daemon will re-read its config file |
| 27 | | | sample running daemon will sample instantly |
| 28 | | | update not implemented yet |
| 29 | | | (the idea is to save time by doing bulk updates shortly before |
| 30 | | | diagram generation instead of updating the DBs every 10 seconds) |
| 31 | | | version show version of OS-dependant module used |
| 32 | | | showargs show settings hash |
| 33 | | | |