Service Monitor 0.6.0
 
Table of Contents
Start
Table of Contents
1. Conventions
2. General information about David system
3. Terminology
4. Installation
5. Service Manager requirements
6. Installation
7. General
8. Network Service Monitor (dnsmd)
9. Buttons the most often used in Web applications
10. Network Service Monitor Configurator
11. Network Service Browser
 
 

8.4. Description

After startup, the program enters its configuration into databases. It includes a list of hosts, and each host includes a list of TCP ports, that should be moniotred. Network Service Monitor Configurator is a Web application, that allows to prepare such configuration for Network Service Monitor. Changing of the configuration doesn't require restart of Network Service Monitor, because it checks in the normal course, if its configuration isn't changed, and the program can load it again if necessary.

After loading of the configuration, the program periodically connects with TCP ports of specified hosts. A service procedure of the connection depends on a configuration of the given port. Information about each connection are saved in a Database and they are a source of reports, that Network Service Browser prepares. If a connection doesn't work, information about error is saved which follows. Information, that is saved about each connection, the following table presents:

Table 8.2. Saved information about each connection made by dnsmd program

Field Meaning
Start time Start time of the connection procedure with a remote service (TCP port on a remote host).
Connetion time Time from starting of a connection procedure to closing of system function connect().
Total time Time from starting of a connection procedure to closing of the connection.
Operation code A code of closing of the operation: OK, if the connection has no errors or en error code which follows during establishing of the conncection.
A code of action script A code which was returned by a script, if it was run for the connection.

8.4.1. Built in, serviced types of TCP protocols

dnsmd program has built in service of some well-known protocols of application level. There are:

  • SMTP
  • HTTP
  • FTP
  • HTTP i FTP Proxy

Each of protocols is serviced in specific way for it, and it was described shortly in farther part of the document.

8.4.1.1. Service of SMTP protocol

Service of SMTP protocol is that it sends series of commands and picks up results of their work. A list of operations, that are made during service of SMTP protocol, is presented below:

  1. Receiving and verification of a hello code.
  2. Sending: HELO david.
  3. Receiving and verification of a response code.
  4. Sending: QUIT.
  5. Receiving and verification of a response code.
  6. Waiting for closing of the connection by a remote host.

8.4.1.2. Service of HTTP protocol

Service of HTTP protocol is that it sends series of commands and picks up results of their work. A list of operations, that are made during service of HTTP protocol, is presented below:

  1. Sending GET http://hostname/url HTTP/1.0.
  2. Sending Host: hostname
  3. Sending optionally Authorization: Basic coded_user_and_password (algorithm base64 is used to code a user and a password).
  4. Waiting for random data
  5. Waiting for closing of the connection by a remote host.

The last command shows only then a user and a password are given in the port configuration. A word hostname is replaced with a real name of remote host while url is replaced with a path, if it was given in the port configuration.

A result of work of these commands is not veryfied in any way. dnsmd program waits for rendom data and closing of the connection by a remote host.

8.4.1.3. Service of FTP protocol

Service of FTP protocol is that it sends series of commands and picks up results of their work. A list of operations, that are made during service of FTP protocol, is presented below:

  1. Receiving and verification of a hello code.
  2. Sending: QUIT.
  3. Receiving and verification of a response code.
  4. Waiting for closing of the connection by a remote host.

8.4.1.4. Service of proxy protocol for HTTP i FTP

Service of proxy protocol for HTTP and FTP is similar to service of HTTP protocol, and it is used to send a series of commands and pick up results of their work. A list of operations, that are made during service of proxy protocol for HTTP and FTP, is presented below:

  1. Sending GET url HTTP/1.0.
  2. Sending optonally Authorization: Basic coded_user_and_password (algorithm base64 is used to code a user and a password).
  3. Waiting for random data
  4. Waiting for closing of the connection by a remote host.

The last command shows only then a user and a password are given in the port configuration. A word url is replaced with a real location of the file, if it was given in the port configuration. If url wasn't given in the configuration, a default file is an address http://www.w3.org/.

A result of work of these commands is not veryfied in any way. dnsmd program waits for rendom data and closing of the connection by a remote host.

8.4.2. Passing an external script on service of conncection

Service of conncetion also can be possible by an external script specified in a given port configuration. Then, after connection of dnsmd program with a remote host, remote control is passed on to an external program. Its stdin and stdout are redirected on a connection. In this way it can direct exchanging of data. A code of finishing of work is returned by the script and it is saved in result of a given connection.

The script receives connection parameters as its working parameters:

  • A name of a remote host.
  • IP of a remote host.
  • A number of TCP port, on that the conncetion was done.
  • URL which is configured for the port.
  • A user whose is configured for the port.
  • A password which is configured for the port.

You should remember, that a work of the script is longer then timeout parameter for the port, the script work will be disconnected after this time.

8.4.3. Errors, that can appear during establishing of connection.

The following errors can appear during establishing of connection.

Table 8.3. Errors of establishing of the connection.

Error Meaning
EADDRESS Error appers during translation of DNS name of a remote host into its IP address.
ECONNECT connect() function isn't finished success.
ENETDOWN A network, that a remote host works, doesn't work.
ENETUNREACH A network, that a remote host works, is unreach.
ECONNREFUSED A remote host refuses connection.
EHOSTDOWN A remote host doesn't work.
EHOSTUNREACH A remote host is unreach.
ETIMEOUT An operation time is exceeded.
ESCRIPTFAILED Running of a given script is failed.
EOTHER Other (unknown) error has appeared.