Introduction
Ever since the first release of NetSaint, I've been asked if I had plans to support MySQL, PostgresQL, Oracle, or a slew of other data sources. In order to support alternate data stores for things like configuration data, status data, etc. I decided to change a lot of the underlying code in both the core program and CGIs to allow developers to add their own data I/O routines...
One of the major changes that was made in version 0.0.6 was a complete rewrite of the data I/O routines in both the core program and the CGIs. These revisions resulted in the creation of an abstraction layer that separated implementation-specific code for accessing data sources from the data processing routines present in the core and CGIs. The end result of this is a set of external data APIs that allows developers to easily write code to support different types of data sources in the core program and CGIs.
NetSaint 0.0.7 will make use of the new external data APIs to optionally provide native MySQL database support for status, retention, comment, extended, and object data. Developers should be able to write their own routines for providing support for other data sources (PostgresQL and Oracle databases, LDAP servers, etc.) fairly easily.
The reset of this documentation is provided to give developers an overview of how the APIs work and how to write their own code to support other data sources than those already natively provided by NetSaint.
External data types
With the exception of standard logging (to the log file or syslog facility), there are five different types of external data that the core program and/or the CGIs use:
Access to external data
The following table outlines what type of access the core program and CGIs have to each type of external data:
Core Program | CGIs | |
Object data | Read | Read |
Comment data | Read/Write | Read |
Extended data | - | Read |
Status data | Write | Read |
Retention data | Read/Write | - |
API details
For more information on how the various types of external data APIs work, as well as information on writing your own I/O routines for external data in the core program and CGIs, click on one of the links below...