Archive

Posts Tagged ‘jrds’

How to build and deploy JRDS

May 25th, 2009

At my work, we currently use nagios and cacti for monitoring, the “standard” tools. However, why it’s difficult to replace nagios – for many reasons (it use standard flat configuration flies) – I’m looking for a way to replace Cacti. Indeed, it’s written in pure PHP, there is almost no CLI. So, when I add a new host, I need to use my browser, and my mouse, and I don’t like that. By chance, a friend of mine wrote his own tool, called JRDS, in pure Java. I’m actually in test phase, however, here are some pros:

  • It’s Java, no need for php, whatever.
  • JRDS use rrd4j, RRDTool Java implementation
  • Use flat files for configuration, so it’s very easy to manage

However, one of its wort cons i s the lack of documentation! So here some notes to build JRDS :

  1. Fetch and extract JRDS sources from the subversion repository
  2. Fetch and extract RRD4j sources from the subversion repository (note: a dev.java.net account seem to be required)
  3. Build RRD4j
    • # cd rrd4j/rrd4j
    • # ant
    • # cp rrd4j-<version>.jar $JRDS_HOME/trunk/lib
  4. Build JRDS
    • If you don’t have it, download ivy and copy its jar in ~/.ant/lib directory
    • # cd $JRDS_HOME/trunk
    • # ant resolve
    • Extrat c.tld from lib/standard.jar and copy the file in the lib/ directory ( # unzip lib/standard.jar META-INF/c.tld ; mv META-INF/c.tld lib/ ; rmdir META-INF
    • # cp local.properties.sample local.properties
    • Edit local.properties, don’t forget to set jai.home at the end of file
    • # ant war
  5. Before deploy jrds.war, you need to create a properties file, and some directories. See the inital setup chapter of JRDS Userguide.
  6. Note: to deploy JRDS on Glassfish, the only way I found to create the property is to defined in the JVM options. I also have sometimes a deadlock, if that appears, you need to kill the Glassfish process and restart it.


jrds.properties

configdir=/Users/bbonfils/tools/jrds/config
rrddir=/Users/bbonfils/tools/jrds/probe
logfile=/Users/bbonfils/tools/jrds/log/jrds.log
libspath=/Users/bbonfils/sources/jrds/trunk/build/probes.jar
#loglevel=debug


config/host-kaoru.xml

<?xml version="1.0" encoding="UTF-8"?>
<host name="kaoru.asyd.net">
        <snmp community="secret" version="2"/>
        <probe type="TcpSnmp" />
        <probe type="IpSnmp" />
        <probe type="UdpSnmp" />
        <probe type="IcmpSnmp" />
        <probe type="MemLinux" />
        <probe type="CpuRawTimeLinux" />
        <probe type="UcdRawSystemCounter" />
        <probe type="PartitionSpace">
                <arg type="String" value="/" />
        </probe>
        <probe type="IfSnmp">
               <arg type="String" value="eth0" />
        </probe>
        <probe type="CpuLoadFloat" />
        <probe type="TcpStat" />
</host>

Java, Sysadmin