write_sensu plugin¶
| Plugin name | write_sensu |
| Type | write |
| Callbacks | config, notification, write |
| Status | supported |
| Since | 5.5 |
| Copyright | 2015 Fabrice A. Marie |
| License | MIT License |
| Configuration | collectd.conf(5) |
The Write Sensu plugin sends metrics to Sensu Core, an open-source monitoring project.
Synopsis¶
LoadPlugin "write_sensu"
<Plugin write_sensu>
Attribute "production" "true"
Tag "appserver"
<Node "example">
Host "localhost"
Port "3030"
EventServicePrefix "collectd/"
Separator "/"
StoreRates true
AlwaysAppendDS false
# Optionally specify Sensu handlers
Metrics false
#MetricHandler "example_metric_handler"
Notifications false
#NotificationHandler "example_notification_handler"
</Node>
</Plugin>
This will register a write callback with the name write_sensu/example.
Dependencies¶
- none
See also¶
Configuration¶
Configuration options · from collectd.conf(5)
See this section in the full configuration reference
The write_sensu plugin will send values to Sensu, a powerful stream aggregation and monitoring system. The plugin sends JSON encoded data to a local Sensu client using a TCP socket.
Synopsis:
<Plugin "write_sensu">
<Node "example">
Host "localhost"
Port "3030"
StoreRates true
AlwaysAppendDS false
IncludeSource false
MetricHandler "influx"
MetricHandler "default"
NotificationHandler "flapjack"
NotificationHandler "howling_monkey"
Notifications true
</Node>
Tag "foobar"
Attribute "foo" "bar"
</Plugin>
The following options are understood by the write_sensu plugin:
- <Node Name>
-
The plugin's configuration consists of one or more Node blocks. Each block is given a unique Name and specifies one connection to an instance of Sensu. Inside the Node block, the following per-connection options are understood:
- Host Address
- Hostname or address to connect to. Defaults to
localhost. - Port Service
- Service name or port number to connect to. Defaults to
3030. - StoreRates true|false
-
If set to true (the default), convert counter values to rates. If set to false counter values are stored as is, i.e. as an increasing integer number.
This will be reflected in the
collectd_data_source_typetag: If StoreRates is enabled, converted values will have "rate" appended to the data source type, e.g.collectd_data_source_type:derive:rate. - AlwaysAppendDS false|true
- If set the true, append the name of the Data Source (DS) to the "service", i.e. the field that, together with the "host" field, uniquely identifies a metric in Sensu. If set to false (the default), this is only done when there is more than one DS.
- Notifications false|true
- If set to true, create Sensu events for notifications. This is false by default. At least one of Notifications or Metrics should be enabled.
- Metrics false|true
- If set to true, create Sensu events for metrics. This is false by default. At least one of Notifications or Metrics should be enabled.
- Separator String
- Sets the separator for Sensu metrics name or checks. Defaults to "/".
- MetricHandler String
- Add a handler that will be set when metrics are sent to Sensu. You can add several of them, one per line. Defaults to no handler.
- NotificationHandler String
- Add a handler that will be set when notifications are sent to Sensu. You can add several of them, one per line. Defaults to no handler.
- EventServicePrefix String
- Add the given string as a prefix to the event service name. If EventServicePrefix not set or set to an empty string (""), no prefix will be used.
- Tag String
- Add the given string as an additional tag to the metric being sent to Sensu.
- Attribute String String
- Consider the two given strings to be the key and value of an additional attribute for each metric being sent out to Sensu.
- IncludeSource false|true
-
If set to true, then the source host of the metrics/notification is passed on to sensu using the source attribute. This may register the host as a proxy client in sensu.
If set to false (the default), then the hostname is discarded, making it appear as if the event originated from the connected sensu agent.