linux.conf 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. ################################################################################
  50. # Checks for updates, newer kernels, libs, etc. #
  51. ################################################################################
  52. apply Service "apt-Updates" {
  53. import "generic-service"
  54. check_command = "apt"
  55. if (host.name != NodeName) {
  56. command_endpoint = host.name
  57. }
  58. check_interval = 15m
  59. assign where host.address && host.vars.os == "Linux"
  60. }
  61. apply Service "running_kernel" {
  62. import "generic-service"
  63. check_command = "needrestart_kernel"
  64. if (host.name != NodeName) {
  65. command_endpoint = host.name
  66. }
  67. check_interval = 15m
  68. assign where host.address && host.vars.os == "Linux"
  69. }
  70. apply Service "libs" {
  71. import "generic-service"
  72. check_command = "needrestart_libs"
  73. if (host.name != NodeName) {
  74. command_endpoint = host.name
  75. }
  76. check_interval = 15m
  77. assign where host.address && host.vars.os == "Linux"
  78. }