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.

79 lines
2.6KB

  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. linux_logs_counter:
  35. engine: sandbox
  36. module_file: /usr/share/lma_collector/filters/logs_counter.lua
  37. module_dir: /usr/share/lma_collector/common;/usr/share/heka/lua_modules
  38. preserve_data: true
  39. message_matcher: "Type == 'log' && Logger =~ /^openstack\\\\./"
  40. ticker_interval: 1
  41. config:
  42. interval: 60
  43. grace_interval: 30
  44. hostname: '{{ grains.host }}'
  45. metric_collector:
  46. trigger:
  47. linux_system_cpu_critical:
  48. description: 'The CPU usage is too high.'
  49. severity: critical
  50. rules:
  51. - metric: cpu_wait
  52. relational_operator: '>='
  53. threshold: 35
  54. window: 120
  55. periods: 0
  56. function: avg
  57. - metric: cpu_idle
  58. relational_operator: <=
  59. threshold: 5
  60. window: 120
  61. function: avg
  62. linux_system_cpu_warning:
  63. description: 'The CPU wait times are high.'
  64. severity: critical
  65. rules:
  66. - metric: cpu_wait
  67. relational_operator: '>='
  68. threshold: 15
  69. window: 120
  70. periods: 0
  71. function: avg
  72. alarm:
  73. linux_system_cpu:
  74. notifications: False
  75. alerting: True
  76. triggers:
  77. - linux_system_cpu_warning
  78. - linux_system_cpu_critical