Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.2KB

  1. {%- from "linux/map.jinja" import system with context %}
  2. log_collector:
  3. decoder:
  4. system:
  5. engine: sandbox
  6. module_file: /usr/share/lma_collector/decoders/generic_syslog.lua
  7. module_dir: /usr/share/lma_collector/common;/usr/share/heka/lua_modules
  8. config:
  9. syslog_pattern: '<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n'
  10. fallback_syslog_pattern: '%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n'
  11. {%- if system.timezone is defined %}
  12. tz: "{{ system.timezone }}"
  13. {%- endif %}
  14. input:
  15. linux_log_stream:
  16. engine: logstreamer
  17. log_directory: "/var/log"
  18. file_match: '(?P<Service>daemon\.log|cron\.log|haproxy\.log|kern\.log|auth\.log|syslog|messages|debug)'
  19. differentiator: [ 'system.', 'Service' ]
  20. decoder: "system_decoder"
  21. splitter: "TokenSplitter"
  22. filter:
  23. linux_hdd_errors:
  24. engine: sandbox
  25. module_file: /usr/share/lma_collector/filters/hdd_errors_counter.lua
  26. module_dir: /usr/share/lma_collector/common;/usr/share/heka/lua_modules
  27. preserve_data: false
  28. message_matcher: "Type == 'log' && Logger == 'system.kern'"
  29. ticker_interval: 10
  30. config:
  31. grace_interval: 10
  32. patterns: "/error%s.+([sv]d[a-z][a-z]?)%d?/ /([sv]d[a-z][a-z]?)%d?.+%serror/"
  33. hostname: '{{ grains.host }}'
  34. metric_collector:
  35. trigger:
  36. linux_system_cpu_critical:
  37. description: 'The CPU usage is too high.'
  38. severity: critical
  39. rules:
  40. - metric: cpu_wait
  41. relational_operator: '>='
  42. threshold: 35
  43. window: 120
  44. periods: 0
  45. function: avg
  46. - metric: cpu_idle
  47. relational_operator: <=
  48. threshold: 5
  49. window: 120
  50. function: avg
  51. linux_system_cpu_warning:
  52. description: 'The CPU wait times are high.'
  53. severity: critical
  54. rules:
  55. - metric: cpu_wait
  56. relational_operator: '>='
  57. threshold: 15
  58. window: 120
  59. periods: 0
  60. function: avg
  61. alarm:
  62. linux_system_cpu:
  63. notifications: False
  64. alerting: True
  65. triggers:
  66. - linux_system_cpu_warning
  67. - linux_system_cpu_critical