I'm in the need of monitoring in a detailed manner a MySQL dedicated Linux server that is not running apache because it's used for the database exclusively. Is it possible to install the Multi Router Traffic Grapher on it and monitor it from another server?
If not, please suggest any other free monitoring tool as good and simple as MRTG which is a very nice utility, thanks.
MRTG works by creating HTML files - it does not, specifically, need ANY web server. ANY web server can serve the HTML files provided they are stored or copied to a location that the web server can serve up.
So, strictly speaking, yes, you can install MRTG without Apache.
You don't need Apache to install MRTG. MRTG generates HTML pages for visualization of graphics. You can send this html and png files to another server to visualize the contents.
Also you can install MRTG in another server and configure it to get the data from your DB server through SNMP. If you have more servers, maybe you need a tool like Cacti to organize all your hosts and graphics in a fashion way.
Looking at the different processes that are needed.
Server A is a database server that you want to monitor in detail. You can obtain relevant stats on this machine that you want to display using MRTG but you do not want to run MRTG on this server.
Server B is a server running (possibly multiple instances of) MRTG and Apache. MRTG will collect stats from a variety of servers and network devices using SNMP and other protocols, update its databases and the display pages for each statistic monitored. This server would usually also display pages relating to the structure and configuration of the network (some static, some dynamic content).
There are multiple HTTP clients wanting to see the MRTG web pages on server B. If there was only one client then Apache is not needed on server B as a suitably privileged client could display the MRTG HTML files without the need for a web server (e.g. using
sshfs
)So, if you have multiple clients and do not want to run the Apache (or other web server) process on Server A you have to make the statistics data available at appropriate time intervals to the MRTG process(es) on Server B. SNMP is a common way of doing this when using MRTG, not least because MRTG's origins, as the name suggests, are in monitoring network devices where SNMP is the de facto management mechanism. Servers do not always have SNMP processes running and many statistics of interest are not exposed via SNMP MIBs. Hence,
A) If the statistics you need are exposed via an SNMP MIB variable on server A and the server is running an SNMP daemon then MRTG on server B can be configured to use SNMP to obtain the variable's values. You will need to make the usual checks that the data is reliable, whether it needs any conversion (e.g. string to integer via a ConversionCode) and if it is gauge or absolute (or perhaps derive, if using RRDTool), for example.
B) Else use an external monitoring script (see MRTG documentation). The classic example is using
ping
on the MRTG server and graphing the results from that. However, it is equally possible to run a process on server A to collect the data, transfer it to server B (e.g. usingsftp
orssh
) and then reading the data via the external MRTG script (possibly after some pre-processing: e.g. a file of information can be read across from server A to server B and then split into multiple files to be read by multiple external MRTG scripts). There are scripts available that others have written and which may be suitable for a given purpose or at least give a start on writing or customising one for your particular requirement.MRTG doesn't need to be on the MySQL server. It does SNMP queries so what you really want to do (if i'm reading your question right) is install SNMP on the MySQL server and MRTG + Apache/ and query the MySQL server over snmp from there.