Added icinga command and service file
This commit is contained in:
parent
0ddb049772
commit
0d344b456f
2 changed files with 38 additions and 0 deletions
25
command_nmap.conf
Normal file
25
command_nmap.conf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
object CheckCommand "nmap" {
|
||||||
|
import "ipv4-or-ipv6"
|
||||||
|
|
||||||
|
command = [ "/home/nagios/check_nmap.sh/check_nmap.sh" ]
|
||||||
|
timeout = 10m
|
||||||
|
|
||||||
|
arguments = {
|
||||||
|
"--host" = {
|
||||||
|
value = "$nmap_host$"
|
||||||
|
description = "Hostname or address to scan"
|
||||||
|
required = true
|
||||||
|
}
|
||||||
|
"--portrange" = {
|
||||||
|
value = "$nmap_scan_ports$"
|
||||||
|
description = "String with ports in nmap format"
|
||||||
|
}
|
||||||
|
"--known" = {
|
||||||
|
value = "$nmap_allowed_ports$"
|
||||||
|
description = "String with ports in nmap format"
|
||||||
|
repeat_key = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vars.nmap_host = "$check_address$"
|
||||||
|
}
|
13
service_nmap.conf
Normal file
13
service_nmap.conf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
apply Service "nmap" {
|
||||||
|
import "generic-service"
|
||||||
|
|
||||||
|
check_command = "nmap"
|
||||||
|
check_interval = 24h
|
||||||
|
retry_interval = 2h
|
||||||
|
|
||||||
|
for (k => v in host.vars.nmap) {
|
||||||
|
vars["nmap_" + k] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
assign where host.vars.nmap != null
|
||||||
|
}
|
Loading…
Reference in a new issue