jsoninfo plugin

The jsoninfo plugin aims to deliver all of the information about the runtime status and configuration of olsrd. You can request specific chunks of information, or overviews of runtime or startup configuration, or all of the information in one report. Additionally, the jsoninfo plugin will dump the current olsrd config in the olsrd.conf format. The jsoninfo plugin provides all of the information that both the txtinfo and httpinfo plugins provide, as well as quite a bit more.

There is a Java library called OlsrInfo that provides Java classes for parsing the data from jsoninfo (and txtinfo also). It is based on the Jackson JSON processing library.

Available Data

There are a number of commands for getting information from this plugin. They are designed to be tacked onto a URL, but can also be sent directly via a network socket. The commands are similar to the txtinfo plugin, but not exactly the same.

If there is no command or no recognized command, then it sends the /status output, which is the combination of /neighbors, /links, /routes, /hna, /mid, /topology, /gateways, and /interfaces.

grouped information:

  • all - all of the data in JSON format
  • runtime - all of the data that reflects the runtime status of olsrd and the mesh
  • startup - all of the data about the startup configuration

runtime information:

  • neighbors (including 2-hop)
  • links
  • routes
  • hna
  • mid
  • topology
  • gateways
  • interfaces
  • status - data that changes during runtime (all above commands combined)

start-up information:

  • config - the current configuration, i.e. what was loaded from the olsrd.conf
  • plugins - currently loaded plugins and their config parameters

start-up information not in JSON format:

  • olsrd.conf - the current config, formatted for writing directly to /etc/olsrd.conf

Plugin Configuration in olsrd.conf

The plugin accepts two parameters: port and accept. There are no
futher parameters. Here's an example configuration for UNIX systems (for Windows, change the plugin to end in .dll):

LoadPlugin "olsrd_jsoninfo.so.0.0"
# the default port is 9090 but you can change it like this:
#PlParam "port" "8080"

# You can set a "accept" single address to allow to connect to
# jsoninfo. If no address is specified, then localhost (
# is allowed by default. jsoninfo will only use the first "accept"
# parameter specified and will ignore the rest.

# to allow a specific host:
#PlParam "accept" ""
# if you set it to, it will accept all connections
#PlParam "accept" ""

# specify a UUID for this node to track it for debugging
#PlParam "UUIDFile" "/etc/olsrd/olsrd.uuid"

Example Usage

You can use http URLs with various web tools to access the information:
curl http://localhost:9090/all

You can combine the various commands to generate a custom report:
curl http://localhost:9090/interfaces/routes/links

If you want a copy of the current configuration, you can download it using this URL:
wget http://localhost:9090/olsrd.conf