Skip to content

Telegraf input plugin for monitoring Corosync cluster node status

License

Notifications You must be signed in to change notification settings

niasar/corosync-telegraf-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegraf corosync external plugin

This plugins monitors corosync cluster node status.

Requirements

This plugin only works witch corosync versions >=3

Building

Building require go version >=1.22

go build -o corosync-plugin ./cmd/main.go

Usage

Create configuration file for plugin

[[inputs.corosync]]
  ## Set to false if you running telegraf as root
  # use_sudo = true

If you running telegraf as non-root, then you need to add sudoers rules for its user to allow execution of corosync-quorumtool and corosync-cfgtool:

Cmnd_Alias    QUORUMTOOL = /usr/sbin/corosync-quorumtool
Cmnd_Alias    CFGTOOL = /usr/sbin/corosync-cfgtool

telegraf ALL=(ALL) NOPASSWD: QUORUMTOOL, CFGTOOL

Defaults!CFGTOOL, QORUMTOOL !syslog, !pam_session, !logfile

Add execd input for telegraf

[[inputs.execd]]
command = ["/path/to/plugin/binary", "-config", "/path/to/plugin/config"]
signal = "none"

Collected data

corosync_quorum:

  • Fields:
    • Ring ID (string)
    • Total nodes (uint)
    • Total votes (uint)
    • Expected votes (uint)
    • Highest expected (uint)
    • Quorum (uint)
    • Quorate flag (bool)
  • Tags:
    • Node ID

corosync_rings:

  • Fields:
    • Active count (uint)
    • Connected count (uint)
    • Enabled count (uint)
    • Unknown count (uint)
    • Undefined count (any other status) (uint)
  • Tags:
    • Ring ID

Sample output

corosync_quorum,node_id=2 total_nodes=5i,ring_id="1.2a8",total_votes=5i,expected_votes=5i,highest_expected=5i,quorum=3i,is_quorate=true 1710019927989283282
corosync_rings,ring_id=0 active=4i,connected=0i,enabled=0i,unknown=0i,undefined=0i,total=4i 1710019927989294042

About

Telegraf input plugin for monitoring Corosync cluster node status

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages