# !!!!! Managed by Ansible !!!!!

# nechceme zbytecne logy kazdou minutu
dontLogTCPWrappersConnects true # ale bohuzel to nefunguje :(

###############################################################################
# Access Control
###############################################################################

####
# First, map the community name "public" into a "security name"

#       sec.name  source          community
com2sec notConfigUser  default       public

####
# Second, map the security name into a group name:

#       groupName      securityModel securityName
group   notConfigGroup v1            notConfigUser
group   notConfigGroup v2c           notConfigUser

####
# Third, create a view for us to let the group have rights to:

# Make at least  snmpwalk -v 1 localhost -c public system fast again.
#       name           incl/excl     subtree         mask(optional)
view    systemview     included      .1.3.6.1.2.1.1
view    systemview     included      .1.3.6.1.2.1.25.1.1

####
# Finally, grant the group read-only access to the systemview view.

#       group          context sec.model sec.level prefix read   write  notif
access  notConfigGroup ""      any       noauth    exact  systemview none none

# -----------------------------------------------------------------------------

# Here is a commented out example configuration that allows less
# restrictive access.

##      sec.name   source          community
com2sec {{inventory_hostname_short}}   127.0.0.1       {{inventory_hostname_short}}
com2sec {{inventory_hostname_short}}   147.251.48.5    {{inventory_hostname_short}}

##    group.name sec.model  sec.name
group MyROGroup  v2c        {{inventory_hostname_short}}
group MyROGroup  v1         {{inventory_hostname_short}}

##          incl/excl subtree                          mask
view all    included  .1                               80

##               context sec.model sec.level prefix read   write  notif
access MyROGroup ""      any       noauth    exact  all    none   none



###############################################################################
# System contact information
#

# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file:

syslocation "Stratus FI MU Brno"
syscontact "xstill@fi.muni.cz"



###############################################################################
# Executables/scripts
#

extend systemctl /bin/bash -c "echo $(/bin/systemctl is-system-running) $(/bin/systemctl --state=failed --plain --no-legend --no-pager | awk 'BEGIN { ORS=\" \" } { gsub(\".service\", \"\", $1); print $1 }')"

###############################################################################
# load average checks
#
load {{snmpd.load | default("1 0.9 0.8")}}

{% for d in snmpd.disks | default([]) %}
disk  {{d.path}} {{d.free}}
{% endfor %}
# proc smartd 1 1
