linux.conf 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #
  2. # Checks for all Linux Hosts
  3. #
  4. apply Service "cpu_usage" {
  5. import "generic-service"
  6. check_command = "cpu_usage"
  7. assign where host.address && host.vars.os == "linux"
  8. }
  9. apply Service "memory" {
  10. import "generic-service"
  11. check_command = "memory"
  12. if (host.name != NodeName) {
  13. command_endpoint = host.name
  14. }
  15. vars.memory.warning = "10"
  16. vars.memory.critical = "5"
  17. assign where host.address && host.vars.os == "linux"
  18. }
  19. apply Service "disk" {
  20. import "generic-service"
  21. check_command = "disk"
  22. if (host.name != NodeName) {
  23. command_endpoint = host.name
  24. }
  25. # Check all local disks
  26. vars.disk_all = true
  27. vars.disk_local = true
  28. vars.disk_ignore_ereg_path += [ "^/run", "^/var/lib/docker/volumes" ]
  29. vars.disk_exclude_type += ["devtmpfs", "sysfs", "procfs", "proc", "aufs", "tmpfs", "fuse.gvfsd-fuse", "fuse.fuse-remount", "fuse.jetbrains-toolbox", "fuse.sshfs", "fuse.nvim", "debugfs", "tracefs", "nsfs", "vfat", "udf", "overlay" ]
  30. # Set levels
  31. vars.disk.critical = "5%"
  32. vars.disk.warning = "15%"
  33. vars.disk_wfree = "15%"
  34. vars.disk_cfree = "10%"
  35. vars.disk_inode_wfree = "15%"
  36. vars.disk_inode_cfree = "10%"
  37. vars.disk_units = "MB"
  38. assign where host.address && host.vars.os == "linux"
  39. }
  40. apply Service "load" {
  41. import "generic-service"
  42. check_command = "load"
  43. if (host.name != NodeName) {
  44. command_endpoint = host.name
  45. }
  46. vars.load_percpu = "true"
  47. assign where host.address && host.vars.os == "linux"
  48. }
  49. apply Service "systemd_units" {
  50. import "generic-service"
  51. check_command = "systemd_units"
  52. if (host.name != NodeName) {
  53. command_endpoint = host.name
  54. }
  55. max_check_attempts = 5
  56. retry_interval = 1m
  57. check_interval = 5m
  58. assign where host.address && host.vars.os == "linux";
  59. }
  60. ################################################################################
  61. # Checks for updates, newer kernels, libs, etc. #
  62. ################################################################################
  63. apply Service "apt-Updates" {
  64. import "generic-service"
  65. check_command = "apt"
  66. if (host.name != NodeName) {
  67. command_endpoint = host.name
  68. }
  69. check_interval = 15m
  70. assign where host.address && host.vars.os == "linux"
  71. }
  72. apply Service "running_kernel" {
  73. import "generic-service"
  74. check_command = "needrestart_kernel"
  75. if (host.name != NodeName) {
  76. command_endpoint = host.name
  77. }
  78. check_interval = 15m
  79. assign where host.address && host.vars.os == "linux"
  80. }
  81. apply Service "libs" {
  82. import "generic-service"
  83. check_command = "needrestart_libs"
  84. if (host.name != NodeName) {
  85. command_endpoint = host.name
  86. }
  87. check_interval = 15m
  88. assign where host.address && host.vars.os == "linux"
  89. }