User Tools

Site Tools


servicemon

Setting up a checker

Checkers are managed in the SeedDB tool. (Servicemon currently doesn't have its own tool.)

To add a checker, click “Add” under “Services”. This leads to a three-panel box where you can select the IP device and service you want to check. When you have selected a service, you'll get a some boxes to fill in arguments (see Checker arguments below). When you're done, just hit “Add service”

To edit a service, click “Edit” under “Services”. Check the services you want to edit and hit “Edit selected” or “Delete selected”. Editing will give you the same form as above.

  • logfile
  • start / stop servicemon
  • report page

Most checkers have a timeout option. The default value is set in servicemon.conf (5 seconds in the dist version.)

Writing a new checker

Config file

Servicemon uses as standard INI file named servicemon.conf, found in NAV's etc directory.

Checker arguments

dc

Checks a Domain Controller (Windows). Required rpcclient.

Required:

  • username (any valid AD username)

dhcp

Not released yet. (Will be included in 3.6?)

Checks if a DHCP server is up by sending a DHCPINFORM packet and checking if it got a reply.

Requires dhcping (apt-get install dhping) which must be setuid root (chmod +s /usr/sbin/dhcping). (It's probably best to install it in /usr/local/bin/ to keep APT from reverting the setuid bit.)

Optional:

  • timeout (in seconds)

dns

No external requirements. (Uses a bundled and slightly modified version of pydns.)

Required:

  • request (typically a domain, for example 'uninett.no')

Optional

  • port
  • timeout (in seconds)

Implementation notes: Uses a bundled pydns module which is modified to support the CHAOS class query, which is used to request server version. The query is reported to break on Windows DNS servers, and is commented out in the code, but UiTø comments it back in to get the server version. Unbundling it and using the standard pydns will break server version at UiTø.

See https://bugs.launchpad.net/nav/+bug/338655

dummy

Sleeps a random time between 0 and 10 seconds and always reports itself as UP.

ftp

Connects to the FTP server and gets server version from the banner.

Optional:

  • username
  • path
  • password

http / https

Optional:

  • url (example: '/robots.txt'. Note! If you supply a full URL ('http://example/robots.txt') the hostname etc. will be discarded and only the path component ('/robots.txt') will be used)
  • port
  • timeout (in seconds)

Limitations:

  • can only check servers with the same IP address as the netbox (virtual hosts and virtual names are not currently supported)

imap / imaps

Required:

  • username
  • password

Optional:

  • port
  • timeout (in seconds)

ldap

Requires the python-ldap module (apt-get install python-ldap)

The 'base' argument appears to actually be required, and the checker should be modified to reflect this.

Optional:

  • username
  • compare
  • version
  • url
  • filter
  • base (base path, for example: 'dc=uit,dc=no')
  • timeout
  • scope
  • password
  • port

mysql

Connects to the server, gets server version and politely closes the connection without logging in. No arguments required.

Implements what little it needs of the mysql protocol, and requires no external libraries.

oracle

Not tested for some time. Requires the cx_Oracle module which in turn requires Oracle client libraries.

pop3

Required:

  • username
  • password

Optional:

  • port
  • timeout (in seconds)

port

Checks if a given TCP port is open.

Required:

  • port

postgresql

Doesn't do anything PostgreSQL specific. Simply checks if the port is open.

Optional:

  • port
  • timeout (in seconds)

radius

Some of these optional arguments are actually required. The checker should be changed to reflect this.

Requires pyrad (apt-get install python-pyrad)

Optional:

  • username
  • identifier (usually not needed)
  • dictionary (radius dictionary, for example '/usr/local/etc/raddb/dictionary-nav')
  • url
  • secret (radius phrase)
  • timeout (in seconds)
  • password
  • port

(Todo: Find out where that dictionary comes from.)

rpc

Checks if RPC portmapper is running and all requires services are up.

Requires rpcinfo (apt-get install libc-bin, which is probably already installed)

Optional:

  • required (comma separated list of services to require, defaults to 'nfs,nlockmgr,mountd,status')

smb

Requires smbclient (apt-get install smbclient)

Optional:

  • username
  • workgroup
  • hostname
  • timeout (in seconds)
  • password
  • port

smtp

Optional:

  • port
  • timeout (in seconds)

ssh

Optional:

  • port
  • timeout (in seconds)
servicemon.txt · Last modified: 2020/04/09 19:32 by megachip