tobias_richter.librenms_agent

tobias_richter.librenms_agent

Build Status

This tool helps set up SNMP and its extensions on agents that can be checked by LibreNMS. You can also look at tobias_richter.librenms to learn how to set up LibreNMS itself.

This tool has been tested with these SNMP extensions (and might work with others too):

Besides the SNMP extensions, it has also been tested with these Checkmk extensions (and may work with others):

  • dpkg
  • apache
  • proxmox

Requirements

You need Ansible version 2.7 or higher to use this role.

Role Variables

Check defaults/main.yml for the list of role variables.

Essential variables are:

  • librenms_agent_snmp_user
  • librenms_agent_snmp_password
  • librenms_agent_snmp_encryption

Configure SNMP Extensions

Here’s the full set of configuration options:

# custom name, must be unique
- name: pi-hole
  # must match an available script in https://github.com/tobias-richter/librenms-agent/tree/master/snmp
  script: pi-hole
  # controls the force flag of the copy task
  copy_force: no
  # a simple comment
  comment: enable pi hole in librenms
  # custom arguments that are passed to the script call
  args: -c  
  # custom packages that must be present for the script
  packages:
    - jq

Examples for SNMP Extensions:

librenms_agent_snmp_extensions:
- name: osupdate
  script: osupdate
  comment: enable os updates in librenms
- name: ".1.3.6.1.4.1.2021.7890.1 distro"
  script: distro
  comment: enable distribution
- name: entropy
  script: entropy.sh
  comment: monitor entropy
- name: apache
  script: apache-stats.py
  comment: enable apache stats for librenms
- name: certificate
  script: certificate.py
  comment: enable certificate check for librenms
- name: mysql
  script: mysql
  comment: enable mysql in librenms
- name: fail2ban
  script: fail2ban
  comment: enable fail2ban stats for librenms
  args: -c       
- name: pi-hole
  script: pi-hole
  copy_force: no
  comment: enable pi hole in librenms
  packages:
    - jq
- name: raspberry
  script: raspberry.sh
  script_prefix: "/usr/bin/sudo /bin/sh "
  comment: enable raspberry in librenms
- name: smart
  script: "smart"
  args: "-c /etc/snmp/snmpd.d/smart.config"
  comment: enable smart in librenms
- name: ntp-server
  script: ntp-server.sh
  comment: enable ntp-server stats for librenms
- name: ntp-client
  script: ntp-client
  comment: enable ntp-client stats for librenms
- name: ups-nut
  script: ups-nut.sh
  comment: enable monitoring for UPS   

Examples for Checkmk Extensions:

librenms_agent_check_mk_extensions
- script: dpkg
- script: apache
- script: proxmox    

Example Playbook

This example shows how to set up an SNMP agent for LibreNMS with osupdate, distro, and dpkg extension.

- hosts: librenms_agent
  roles:
    - role: tobias_richter.librenms_agent
      librenms_agent_snmp_extensions:
        - name: osupdate
          script: osupdate
          comment: enable os updates in librenms
        - name: ".1.3.6.1.4.1.2021.7890.1 distro"
          script: distro
          comment: enable distribution
      librenms_agent_check_mk_extensions:
        - script: dpkg
Informazioni sul progetto

Ansible Role for setting up and managing librenms clients.

Installa
ansible-galaxy install tobias_richter.librenms_agent
Licenza
apache-2.0
Download
296
Proprietario
Expert DevOps Engineer