Defining loggers
Loggers are used by SimpleMonitor to record the state of all monitors after each interval.
The types of loggers are:
- db: Records the result of every monitor, every iteration (maintaining a history)
- dbstatus: Records a snapshot of the current state of every monitor
- logfile: Records a logfile of the result of every monitor, or only the monitors which failed. Each line is preceeded by the current UNIX timestamp.
- html: Writes an HTML file showing the status of all monitors (including remote ones).
- *network: Sends status of all monitors to a remote host.
Defining a logger
The section name should be the name of your logger. This is the name you should give in the “loggers” setting in the “reporting” section of the configuration. All loggers take these two parameters.
type is the type of logger to create. Choose one of the five in the list above. Required; no default.
depend lists (comma-separated, no spaces) the names of the monitors this logger depends on. Use this if the database file lives over the network. If a monitor it depends on fails, no attempt will be made to update the database. Optional; no default.
db and dbstatus loggers
- path is the path/filename of the SQLite database file. You should initialise the schema of this file using the
monitor.sqlfile in the distribution. You can use the same database file for many loggers. Required; no default.
logfile loggers
filename is the filename to write to. Rotating this file underneath SimpleMonitor will likely result in breakage (this will be addressed later). Required; no default.
buffered: set to 1 if you aren’t going to watch the logfile in real time. If you want to watch it with something like
tail -fthen set this to 0. Optional; default=0.only_failures: set to 1 if you only want failures to be written to the file. Optional; default=0.
html loggers
folder: the folder in which all the needed files live. Required; no default. This is probably going to be
htmlif you don’t move things around from the default distribution.filename is the filename to write out. The file will be updated once per interval (as defined in the main configuration). Required; no default. Relative to the folder. If you don’t write the output file to the same folder as
folderabove, you will need to copy/movestyles.cssto the same place.header is the header include file which is sucked in when writing the output file. Required; no default. Relative to folder.
footer is the footer include file. Required; no default. Relative to folder.
The header and footer files do not necessarily need to be in the publicly accessibly folder that the output is written to, but no harm will come if they are.
The supplied header file includes JavaScript to notify you if the page either doesn’t auto-refresh, or if SimpleMonitor has stopped updating it. This requires your machine running SimpleMonitor and the machine you are browsing from to agree on what the time is (timezone doesn’t matter)!
network
This logger is used to send status reports of all monitors to a remote instance. The remote instance must be configured to listen for connections.
- host: the remote host to send to. Required; no default
- port: the port on the remote host to connect to. Required; no default.
Examples
See the Configuration page for an example configuration.
Add a comment