Symom Documentation Symom & MRTG Windows Linux Windows Linux
MRTG O mrtg the most know program for bandwidth monitoring. It is simple and can also be used for monitoring other units as cpu, memory, disk. The main protocol is SNMP but collecting data method were extended to support integration with other products and tecnics for data acquisition. This document will help people that want to use MRTG monitoring windows machines and collectind data as cpu, memory, disk etc. Symom for Windows Before go on be sure that Symom Service is running. If the buton shows Stop Service is because the service is already running. Or if the buton shows Start Service, so click the buton to start service. Run the program Interface Gráfica to start the graphical client of Symom. Then we will see the tcp/ip port the service is listen on. Click the left buton of mouse over the icon. This will popup a menu with 3 options. The option show will present the main window of the Graphical Client for Symom Service. Then click File and select the config option. This will show the configuration window of Symom and we would be able to select the port os service and many other parameters.
Configuratio Window The configuration window is follow. The option RRDTOOL tell the service to generate some graphics locally with rrdtool. The option NETMON tells the service to monitor network interface. Somo programs like SQL Server turn off the network performance monitoring in the registry. This feature avoid Symom from trying to acquire a data that some times is not available. AllowRemoteExec this option enable the service to act as a manager of the server accepting remote commands. Listen specifies ip address number the service with listen on. The parameter Symom Server is used when the agent is used with Symom Server for Linux. The PORT tells the service the tcp/ip port it should use for accept commands and queries. NetInterface1 and NetInterface2, allow choose the desire network interface Symom should report in monitoring. The parameteres Command1_c e Command2_c is a trick for colecting data by external program, sintaxe is: <dos_command > <command_parameter> <grep_parameter_1> <parâmetro_grep_2> For example, command1_c= netstat -n -p tcp 80 ESTABLISHED Means: netstat n p tcp grep 80 grep ESTABLISHED wc l This will report active connections on port 80 of the current server. LogLevel is a debuging option. Performancemon1 and Performancemon2 are data from perfromance monitor from windows. Remote Clients specifies stations the service will accept request from. For default only local host. When using with Symom Server for Linux or MRTG on remote server, the ip addres of that server must be listed here. Testing de Service We know that the port is 9000 (look port parameter in configuration window), now lets make a simple test in the same erver the service is instaled on. Type the following command: telnet 127.0.0.1 9000 <type enter>
info <type enter> System Monitor by MOEBIUS copyright Version 1.0.56 Command Interfaces CPU 0 - First Processor CPU 1 - Second Processor Memory RAM - RAM Memory Memory SWAP - Swap Memory Memory Virtual - Virtual Memory DISK 1 - Drive C: DISK 2 - Drive D: DISK 3 - Drive E: NETIN 1 - Bytes in ethernet NETOUT 1 - Bytes out ethernet NETIN 2 - Bytes in ethernet (adapter 2) NETOUT 2 - Bytes out ethernet (adapter 2) CMD 1 - First prompt command: CMD 2 - Second prompt command: CMD 3 - Third prompt command: PROCS - Number of processes: THREADS - Number of threads: PERFMON1 - Coleta dados do performance monitor: PERFMON2 - Coleta dados do performance monitor: PERFMON3 - Coleta dados do performance monitor: QUIT - Exit: EXEC - Executa um programa localizado no diretorio \Tasks EXETASK - Executa um script do diretorio \Tasks QUERYTASK - Consulta o status ou lista dados de uma task SERVICE_LIST - Lista o status de todos os servios SERVICE_START - Inicia um servio SERVICE_STOP - Para um servio SERVICE_STATUS - Exibe o status de um servio SWINV - Retorna o inventario de software da maquina TASKS - Listas os comandos disponiveis no diretorio \Tasks INFO - This Help :-)z <more information goes here...> quit<type enter> The command, info, list available options. Beyond this command we have the command computername that shows the name of server the service is running on. The command resumemon will list a resume of all monitoring data. For example, to know the cpu consuption of server at ip 17.0.0.1, use the command: telnet 17.0.0.1 9000 cpu <type enter> 3 quit<type enter> That shows a 3% CPU utilization at server 17.0.0.1
Symom & MRTG To get information from Symom and pass to MRTG we need a small Perl program named getmrtg. #!/usr/bin/perl use IO::Socket; ############################################################################################## ############# Symom + MRTG #### By M o e b i u s ############################################ ############################################################################################## if (@ARGV < 1) { print "usage: $0 host port...\n" } else{ $host = shift(@argv); $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => "9000", ); unless ($remote) { die "cannot connect to monitor daemon on $host" } print $remote "NETIN1 \nnetout1 \ncomputername \n"; $remote->autoflush(1); print $remote "quit\n"; while ( <$remote> ) { print $_; } close $remote; This program use tcp/ip to query a remote server running Symom service to acquire network bandwidth. The word in bold are the command passe to Symom on remote servr. This commands could be CPU1 \ncpu2 \n COMPUTERNAME to have a cpu utilization. The tag Target of a configuration file for MRTG using Symom would be: Target[Serv_Windows]: `getmrtg 10.2.1.1`