Initial release
This commit is contained in:
parent
9d67c7d1cd
commit
0d0e2dafab
|
@ -0,0 +1,27 @@
|
|||
smokeping-formula
|
||||
===============
|
||||
|
||||
Formula to set up and configure smokeping.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
See the full `Salt Formulas installation and usage instructions
|
||||
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
|
||||
|
||||
Available states
|
||||
================
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
|
||||
``smokeping``
|
||||
-----------
|
||||
|
||||
Installs smokeping
|
||||
|
||||
``smokeping.config``
|
||||
------------------
|
||||
|
||||
Manages smokeping configuration file(s)
|
|
@ -0,0 +1,21 @@
|
|||
smokeping:
|
||||
owner: Peter Random
|
||||
contact: noc@email.to.nowhere
|
||||
|
||||
alerts:
|
||||
from: smokealert@company.xy
|
||||
to: alertee@address.somewhere
|
||||
|
||||
bigloss:
|
||||
type: loss
|
||||
pattern: ==0%,==0%,==0%,==0%,>0%,>0%,>0%
|
||||
comment: suddenly there is packet loss
|
||||
|
||||
targets:
|
||||
alerts: bigloss
|
||||
LocalMachine:
|
||||
menu: Local Machine
|
||||
title: This host
|
||||
remark: Pinging 127.0.0.1
|
||||
host: localhost
|
||||
alerts: someloss
|
|
@ -0,0 +1,26 @@
|
|||
{% from "smokeping/map.jinja" import smokeping with context %}
|
||||
|
||||
include:
|
||||
- smokeping
|
||||
|
||||
smokeping_cfg:
|
||||
file.managed:
|
||||
- name: /etc/smokeping/config
|
||||
- source: salt://smokeping/files/config
|
||||
- template: jinja
|
||||
- user: root
|
||||
- watch_in:
|
||||
- service: smokeping
|
||||
- require:
|
||||
- pkg: smokeping
|
||||
|
||||
{% for config in ['General', 'Database', 'Alerts', 'Targets', 'Presentation', 'Probes', 'pathnames'] %}
|
||||
smokeping_config_d_{{config}}:
|
||||
file.managed:
|
||||
- name: /etc/smokeping/config.d/{{ config }}
|
||||
- source: salt://smokeping/files/{{ config }}
|
||||
- template: jinja
|
||||
- user: root
|
||||
- watch_in:
|
||||
- service: smokeping
|
||||
{% endfor %}
|
|
@ -0,0 +1,15 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
*** Alerts ***
|
||||
|
||||
to = {{ salt['pillar.get']('smokeping:alerts:to', 'alertee@address.somewhere') }}
|
||||
from = {{ salt['pillar.get']('smokeping:alerts:from', 'smokealert@company.xy') }}
|
||||
|
||||
{% for alert, options in smokeping.alerts.iteritems() -%}
|
||||
{% if options is mapping() %}
|
||||
+ {{ alert }}
|
||||
{% for key, value in options.iteritems() -%}
|
||||
{{ key }} = {{ value }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
|
@ -0,0 +1,16 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
*** Database ***
|
||||
|
||||
step = {{ smokeping.database.step }}
|
||||
pings = {{ smokeping.database.pings }}
|
||||
|
||||
# consfn mrhb steps total
|
||||
|
||||
AVERAGE 0.5 1 1008
|
||||
AVERAGE 0.5 12 4320
|
||||
MIN 0.5 12 4320
|
||||
MAX 0.5 12 4320
|
||||
AVERAGE 0.5 144 720
|
||||
MAX 0.5 144 720
|
||||
MIN 0.5 144 720
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
*** General ***
|
||||
|
||||
owner = {{ salt['pillar.get']('smokeping:owner', 'Peter Random') }}
|
||||
contact = {{ salt['pillar.get']('smokeping:contact', 'some@address.nowhere') }}
|
||||
mailhost = {{ salt['pillar.get']('smokeping:mailhost', 'my.mail.host') }}
|
||||
# NOTE: do not put the Image Cache below cgi-bin
|
||||
# since all files under cgi-bin will be executed ... this is not
|
||||
# good for images.
|
||||
cgiurl = {{ salt['pillar.get']('smokeping:cgirul', 'http://some.url/smokeping.cgi') }}
|
||||
# specify this to get syslog logging
|
||||
syslogfacility = {{ smokeping.syslogfacility }}
|
||||
# each probe is now run in its own process
|
||||
# disable this to revert to the old behaviour
|
||||
# concurrentprobes = no
|
||||
|
||||
@include /etc/smokeping/config.d/pathnames
|
|
@ -0,0 +1,57 @@
|
|||
*** Presentation ***
|
||||
|
||||
template = /etc/smokeping/basepage.html
|
||||
charset = utf-8
|
||||
|
||||
+ charts
|
||||
|
||||
menu = Charts
|
||||
title = The most interesting destinations
|
||||
|
||||
++ stddev
|
||||
sorter = StdDev(entries=>4)
|
||||
title = Top Standard Deviation
|
||||
menu = Std Deviation
|
||||
format = Standard Deviation %f
|
||||
|
||||
++ max
|
||||
sorter = Max(entries=>5)
|
||||
title = Top Max Roundtrip Time
|
||||
menu = by Max
|
||||
format = Max Roundtrip Time %f seconds
|
||||
|
||||
++ loss
|
||||
sorter = Loss(entries=>5)
|
||||
title = Top Packet Loss
|
||||
menu = Loss
|
||||
format = Packets Lost %f
|
||||
|
||||
++ median
|
||||
sorter = Median(entries=>5)
|
||||
title = Top Median Roundtrip Time
|
||||
menu = by Median
|
||||
format = Median RTT %f seconds
|
||||
|
||||
+ overview
|
||||
|
||||
width = 600
|
||||
height = 50
|
||||
range = 10h
|
||||
|
||||
+ detail
|
||||
|
||||
width = 600
|
||||
height = 200
|
||||
unison_tolerance = 2
|
||||
|
||||
"Last 3 Hours" 3h
|
||||
"Last 30 Hours" 30h
|
||||
"Last 10 Days" 10d
|
||||
"Last 360 Days" 360d
|
||||
|
||||
#+ hierarchies
|
||||
#++ owner
|
||||
#title = Host Owner
|
||||
#++ location
|
||||
#title = Location
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
*** Probes ***
|
||||
|
||||
{% for probe, settings in smokeping.probes.iteritems() %}
|
||||
+ {{ probe }}
|
||||
{% for key, value in settings.items() %}
|
||||
{{ key }} = {{ value }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
|
@ -0,0 +1,20 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
{%- set targets = smokeping.targets -%}
|
||||
*** Targets ***
|
||||
|
||||
probe = {{ smokeping.targets.probe }}
|
||||
menu = Top
|
||||
title = {{ smokeping.targets.title }}
|
||||
remark = {{ salt['pillar.get']('smokeping:targets:remark', '') }}
|
||||
alerts = {{ salt['pillar.get']('smokeping:targets:alerts', '') }}
|
||||
|
||||
{% for target, options in smokeping.targets.iteritems() -%}
|
||||
{% if options is mapping() -%}
|
||||
+ {{ target }}
|
||||
|
||||
{% for key, value in options.iteritems() -%}
|
||||
{{ key }} = {{ value }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
|
@ -0,0 +1,7 @@
|
|||
@include /etc/smokeping/config.d/General
|
||||
@include /etc/smokeping/config.d/Alerts
|
||||
@include /etc/smokeping/config.d/Database
|
||||
@include /etc/smokeping/config.d/Presentation
|
||||
@include /etc/smokeping/config.d/Probes
|
||||
@include /etc/smokeping/config.d/Slaves
|
||||
@include /etc/smokeping/config.d/Targets
|
|
@ -0,0 +1,8 @@
|
|||
{%- from "smokeping/map.jinja" import smokeping with context -%}
|
||||
sendmail = {{smokeping.lookup.sendmail}}
|
||||
imgcache = {{smokeping.lookup.imgcache}}
|
||||
imgurl = {{smokeping.lookup.imgurl}}
|
||||
datadir = {{smokeping.lookup.datadir}}
|
||||
piddir = {{smokeping.lookup.piddir}}
|
||||
smokemail = {{smokeping.lookup.smokemail}}
|
||||
tmail = {{smokeping.lookup.tmail}}
|
|
@ -0,0 +1,9 @@
|
|||
{% from "smokeping/map.jinja" import smokeping with context %}
|
||||
|
||||
smokeping:
|
||||
pkg.installed:
|
||||
- name: {{ smokeping.lookup.pkg }}
|
||||
|
||||
service.running:
|
||||
- name: smokeping
|
||||
- enable: True
|
|
@ -0,0 +1,35 @@
|
|||
{% set smokeping = salt['pillar.get']('smokeping', {
|
||||
'lookup': salt['grains.filter_by']({
|
||||
'Debian': {
|
||||
'pkg': 'smokeping',
|
||||
'sendmail': '/usr/sbin/sendmail',
|
||||
'imgcache': '/var/cache/smokeping/images',
|
||||
'imgurl': '../smokeping/images',
|
||||
'datadir': '/var/lib/smokeping',
|
||||
'piddir': '/var/run/smokeping',
|
||||
'smokemail': '/etc/smokeping/smokemail',
|
||||
'tmail': '/etc/smokeping/tmail',
|
||||
},
|
||||
}),
|
||||
'database': {
|
||||
'step': 300,
|
||||
'pings': 20,
|
||||
},
|
||||
'syslogfacility': 'local0',
|
||||
'targets': {
|
||||
'probe': 'FPing',
|
||||
'title': 'Network Latency Grapher',
|
||||
},
|
||||
'probes': {
|
||||
'FPing': {
|
||||
'binary': '/usr/bin/fping',
|
||||
},
|
||||
},
|
||||
'alerts': {
|
||||
'someloss': {
|
||||
'type': 'loss',
|
||||
'pattern': '>0%,*12*,>0%,*12*,>0%',
|
||||
'comment': 'loss 3 times in a row',
|
||||
},
|
||||
},
|
||||
}, merge=True) %}
|
Loading…
Reference in New Issue