|
1 | | -const nc_binary = "/usr/bin/nagocheck" |
2 | | -const nc_base_args = { |
3 | | - "--verbose" = { |
4 | | - set_if = "$nc_verbose$" |
5 | | - } |
| 1 | +const nagocheck_bin = "/usr/bin/nagocheck" |
| 2 | +const nagocheck_args = { |
| 3 | + "--verbose" = { |
| 4 | + set_if = "$nc_verbose$" |
| 5 | + } |
6 | 6 | } |
7 | 7 |
|
8 | | -object CheckCommand "nc_load" { |
9 | | - import "plugin-check-command" |
10 | | - |
11 | | - command = [nc_binary, "system", "load"] |
12 | | - arguments = nc_base_args + { |
13 | | - "--warning" = "$nc_load_warning$" |
14 | | - "--critical" = "$nc_load_critical$" |
15 | | - "--per-cpu" = { |
16 | | - set_if = "$nc_load_per_cpu$" |
17 | | - } |
18 | | - } |
| 8 | +object CheckCommand "nc_system_interface" { |
| 9 | + import "plugin-check-command" |
| 10 | + |
| 11 | + command = [ nagocheck_bin, "system", "interface" ] |
| 12 | + arguments = nagocheck_args + { |
| 13 | + "<name>" = { |
| 14 | + value = "$nc_system_interface_name$" |
| 15 | + required = true |
| 16 | + skip_key = true |
| 17 | + } |
| 18 | + |
| 19 | + "--speed" = "$nc_system_interface_speed$" |
| 20 | + "--duplex" = "$nc_system_interface_duplex$" |
| 21 | + } |
| 22 | + |
| 23 | + vars.nc_system_interface_duplex = "full" |
| 24 | + vars.nc_system_interface_speed = 1000 |
| 25 | +} |
| 26 | + |
| 27 | +object CheckCommand "nc_system_load" { |
| 28 | + import "plugin-check-command" |
| 29 | + |
| 30 | + command = [ nagocheck_bin, "system", "load" ] |
| 31 | + arguments = nagocheck_args + { |
| 32 | + "--warning" = "$nc_system_load_warning$" |
| 33 | + "--critical" = "$nc_system_load_critical$" |
| 34 | + "--per-cpu" = { |
| 35 | + set_if = "$nc_system_load_per_cpu$" |
| 36 | + } |
| 37 | + } |
| 38 | + |
| 39 | + vars.nc_system_load_warning = 1 |
| 40 | + vars.nc_system_load_critical = 1.5 |
| 41 | + vars.nc_system_load_per_cpu = true |
19 | 42 | } |
20 | 43 |
|
21 | | -object CheckCommand "nc_memory" { |
22 | | - import "plugin-check-command" |
23 | | - |
24 | | - command = [nc_binary, "system", "memory"] |
25 | | - arguments = nc_base_args + { |
26 | | - "--warning" = "$nc_memory_warning$" |
27 | | - "--critical" = "$nc_memory_critical$" |
28 | | - "--count-reclaimable" = { |
29 | | - set_if = "$nc_memory_count_reclaimable$" |
30 | | - } |
31 | | - } |
| 44 | +object CheckCommand "nc_system_memory" { |
| 45 | + import "plugin-check-command" |
| 46 | + |
| 47 | + command = [ nagocheck_bin, "system", "memory" ] |
| 48 | + arguments = nagocheck_args + { |
| 49 | + "--warning" = "$nc_system_memory_warning$" |
| 50 | + "--critical" = "$nc_system_memory_critical$" |
| 51 | + "--count-reclaimable" = { |
| 52 | + set_if = "$nc_system_memory_count_reclaimable$" |
| 53 | + } |
| 54 | + } |
| 55 | + |
| 56 | + vars.nc_system_memory_warning = 80 |
| 57 | + vars.nc_system_memory_critical = 90 |
| 58 | + vars.nc_system_memory_count_reclaimable = false |
32 | 59 | } |
33 | 60 |
|
34 | | -object CheckCommand "nc_interface" { |
35 | | - import "plugin-check-command" |
| 61 | +object CheckCommand "nc_system_session" { |
| 62 | + import "plugin-check-command" |
36 | 63 |
|
37 | | - command = [nc_binary, "system", "interface"] |
38 | | - arguments = nc_base_args + { |
39 | | - "<name>" = { |
40 | | - value = "$nc_interface_name$" |
41 | | - required = true |
42 | | - skip_key = true |
43 | | - } |
| 64 | + command = [ nagocheck_bin, "system", "session" ] |
| 65 | + arguments = nagocheck_args + { |
| 66 | + "--warning" = "$nc_system_session_warning$" |
| 67 | + "--critical" = "$nc_system_session_critical$" |
| 68 | + "--lifetime" = "$nc_system_session_lifetime$" |
| 69 | + } |
44 | 70 |
|
45 | | - "--speed" = "$nc_interface_speed$" |
46 | | - "--duplex" = "$nc_interface_duplex$" |
47 | | - } |
| 71 | + vars.nc_system_session_warning = 3 |
| 72 | + vars.nc_system_session_critical = 5 |
| 73 | + vars.nc_system_session_lifetime = 21600 |
48 | 74 | } |
49 | 75 |
|
50 | | -object CheckCommand "nc_bgp_neighbor" { |
51 | | - import "plugin-check-command" |
52 | | - |
53 | | - command = [nc_binary, "frrouting", "bgp-neighbor"] |
54 | | - arguments = nc_base_args + { |
55 | | - "<neighbor>" = { |
56 | | - value = "$nc_bgp_neighbor_address$" |
57 | | - required = true |
58 | | - skip_key = true |
59 | | - } |
60 | | - |
61 | | - "--mode" = "$nc_bgp_neighbor_mode$" |
62 | | - "--vtysh-path" = "$nc_bgp_neighbor_vtysh_path$" |
63 | | - "--telnet-address" = "$nc_bgp_neighbor_telnet_address$" |
64 | | - "--telnet-password" = "$nc_bgp_neighbor_telnet_password$" |
65 | | - |
66 | | - "--prefix-limit" = "$nc_bgp_neighbor_prefix_limit$" |
67 | | - "--uptime" = "$nc_bgp_neighbor_uptime$" |
68 | | - "--critical" = { |
69 | | - set_if = "$nc_bgp_neighbor_critical$" |
70 | | - } |
71 | | - } |
| 76 | +object CheckCommand "nc_system_swap" { |
| 77 | + import "plugin-check-command" |
| 78 | + |
| 79 | + command = [ nagocheck_bin, "system", "swap" ] |
| 80 | + arguments = nagocheck_args + { |
| 81 | + "--warning" = "$nc_system_swap_warning$" |
| 82 | + "--critical" = "$nc_system_swap_critical$" |
| 83 | + } |
| 84 | + |
| 85 | + vars.nc_system_swap_warning = 25 |
| 86 | + vars.nc_system_swap_critical = 50 |
| 87 | +} |
| 88 | + |
| 89 | +object CheckCommand "nc_system_temperature" { |
| 90 | + import "plugin-check-command" |
| 91 | + |
| 92 | + command = [ nagocheck_bin, "system", "temperature" ] |
| 93 | + arguments = nagocheck_args + { |
| 94 | + "--warning" = "$nc_system_temperature_warning$" |
| 95 | + "--critical" = "$nc_system_temperature_critical$" |
| 96 | + } |
| 97 | + |
| 98 | + vars.nc_system_temperature_warning = 70 |
| 99 | + vars.nc_system_temperature_critical = 80 |
| 100 | +} |
| 101 | + |
| 102 | +object CheckCommand "nc_system_uptime" { |
| 103 | + import "plugin-check-command" |
| 104 | + |
| 105 | + command = [ nagocheck_bin, "system", "uptime" ] |
| 106 | + arguments = nagocheck_args + { |
| 107 | + "--warning" = "$nc_system_uptime_warning$" |
| 108 | + "--critical" = "$nc_system_uptime_critical$" |
| 109 | + } |
| 110 | + |
| 111 | + vars.nc_system_uptime_warning = "60:" |
| 112 | + vars.nc_system_uptime_critical = "" |
72 | 113 | } |
0 commit comments