The SAYMON architecture allows users to develop server extensions, that add to SAYMON the functionality the users need. An example of such functionality may be additional data collectors that quering special equipment or modules that send notifications to channels that a customer needs (for instance, syslog or Jabber chat).
For more information on how to develop server extensions — actors — see in the examples of this section.
Actor is a module that can:
- receive messages,
- send messages,
- spawn child actors.
The main property of the actor is its complete isolation from other modules and the ability to communicate with these modules only via messages. It allows to scale actors flexibly, depending on the load.
SAYMON server uses the actor model for server extensions, since it itself is implemented according to the actor model. The Comedy library is used as an implementation of the actor model. To develop server extensions it is essential to be familiar with this library.
The simplest example of a custom extension is a module that sends greeting to a log. This example is as follows:
In order to load the above module into SAYMON, it is necessary to:
- save the code to a file (for example,
- add the parameter "extension_path":
"/tmp/saymon-modules"(full directory) to the section Server of the server configuration file.
To apply changes the service saymon-server must be restarted:
After that, the following message will appear in the SAYMON server log: