User:Delimiter/FreeBSD//Cricket

From ConShell
Jump to navigation Jump to search

A guide for setting up Cricket on FreeBSD.

First you'll want to install cricket.

cd /usr/ports/net-mgmt/cricket/
make && make install clean
...
Added group "cricket".
Added user "cricket".
/usr/sbin/chown -R cricket:cricket /usr/local/cricket
/bin/ln -s /usr/local/cricket/cricket-1.0.5  /usr/local/cricket/cricket
Sample config installed at:
        /usr/local/etc/cricket-conf.pl.dist

Cricket has been installed in /usr/local/cricket. You'll find
executables and configfiles there. Please take a look at
http://cricket.sourceforge.net/. The documentation can be
found in /usr/local/cricket/cricket/doc/ too.
===>   Registering installation for cricket-1.0.5_4


This also pulls in rrdtool-1.2.23 and freetype2-2.3.5 and a bunch of other crap.

Fine, now you have it installed but it doesn't do much until you copy/tweek cricket-conf.pl and also add some targets.

cd /usr/local/etc
mv cricket-conf.pl.dist cricket-conf.pl

The default values should suffice (TBD).

Now drop into /usr/local/cricket/cricket this is where the remaining action happens.

Discover the SNMP OIDs of the host you want to monitor. See Snmp for some details about enumeration. For my part, I just installed net-snmp on my localhost (franco) and fired up snmpd.

I discover the uptime by just doing this...

$ snmpget -Os -c public -v 2c franco sysUptimeInstance
sysUpTimeInstance = Timeticks: (21914096) 2 days, 12:52:20.96

Next you'll want to setup a folder to start laying targets into.

Add this line to /usr/local/cricket/cricket/subtree-sets

/freebsd

and mkdir freebsd

Hop into the freebsd folder and create a file called (again) "Defaults". This will setup values for our freebsd hosts! Copy the sample Defaults file and massage.

cp sample-config/Defaults freebsd/

change, at a minimum...

  • data-dir
  • snmp-community

TO BE CONTINUED... (This is the Defaults from freebsd/) different from the base Defaults

# Load averages.
OID    ucd_load1min         1.3.6.1.4.1.2021.10.1.3.1
OID    ucd_load5min         1.3.6.1.4.1.2021.10.1.3.2
OID    ucd_load15min        1.3.6.1.4.1.2021.10.1.3.3

##### Datasources #########
datasource ucd_load1min
    ds-source    = snmp://%snmp%/ucd_load1min
    rrd-ds-type  = GAUGE

datasource ucd_load5min
    ds-source    = snmp://%snmp%/ucd_load5min
    rrd-ds-type  = GAUGE

datasource ucd_load15min
    ds-source    = snmp://%snmp%/ucd_load15min
    rrd-ds-type  = GAUGE
#### Target Types #########
targetType    ucd_System_basic
    ds    = "ucd_load1min, ucd_load5min, ucd_load15min"

    view  = "Load: ucd_load1min ucd_load5min ucd_load15min"
#### Graphs ###############
graph    ucd_load1min
    legend    = "1 Min Load Av"
    si-units= false

graph    ucd_load5min
    legend    = "5 Min Load Av"
    si-units= false

graph    ucd_load15min
    legend    = "15 Min Load Av"
    si-units= false


Next we create directory named after the host we want to monitor and below it a simple targets file that extends upon the Defaults.

cat localhost/targets 
target localhost
  long-desc     = "Some long description about localhost"
  ip            = "127.0.0.1"
  target-type   = ucd_System_basic

That should be all we need to start monitoring.

Run cricket's "compile" command to build the database.