Introduction to NAGIOSQL Database structure
Personally feel that if you understand a system's architecture, you should start with the database, because the database is the soul, of course, the premise is that the system uses the database. Just talked about the structure, I really do not know what is the structure of what is the end, I do not know whether the first sentence is justified, because I really do not understand the development, but also did not understand the architecture of a system. Hey.
Let's start with a MySQL database table, see 1.4.
This table is the table used by Nagiosql, in the two development process, please use the system default table as much as possible, because this can minimize the system error probability, but if you add fields in the table carefully. Because one of the main reasons is: Nagiosql will write the configuration file, in the process of writing a configuration file, it will select * from table, haha. (After the article, I will introduce the solution!) )
Below is a brief introduction to the next round of the tables, they are commonly used, Tbl_ is the default prefix, Tbl_lnk represents the association table:
Nagiosql Source Code Structure Introduction
Source structure such as:
Note: Other non-annotated files are automatically generated configurations.
Nagiosql Run time
Each page shown by the default nagiosql is shown through the tpl.htm template in the Templates directory. Nagiosql uses a template class called Html_template_it to handle the loading, analysis, configuration, and presentation of templates. Have to say that this template processing mechanism is very antique, in addition to the idea and the template used basically consistent, I think the use of this class should now have been forgotten almost, because it is really not very mainstream, so that all kinds of information can not find the introduction and use it. For more information on access to http://pear.php.net/manual/en/package.html.html-template-it.php.
When Nagiosql first runs, the index.php page first loads the functions/prepend_adm.php file and sets the session information through the Session_Start () method on this page. And after the login state preservation and access control is basically all based on the session, which is also due to the powerful PHP session function. The prepend_adm.php file controls the global page display, which is the data source for the global template (including header, footer) main.tpl.htm. functions/nag_class.php controls the left menu and inserts, deletes, and changes the data source of the page. The admin_master.tpl.htm template page controls the main content of each page.
The correspondence between them is briefly as follows:
Please mention the source when the friends reprint, because I am in order to better facilitate everyone to discuss with me. Thank you, sir.
Comments and suggestions: [email protected]
Nagios Two-time Development (III)---NAGIOSQL architecture introduction