2014-06-03 22:45:24 +02:00
|
|
|
### Nano synteax file
|
|
|
|
### Icinga2 object configuration file
|
|
|
|
|
|
|
|
syntax "icinga2" "/etc/icinga2/.*\.conf$" "/usr/share/icinga2/include/(plugin|itl|.*\.conf$)"
|
|
|
|
|
|
|
|
## objects types
|
2015-03-12 16:10:15 +01:00
|
|
|
icolor brightgreen "object[ \t]+(host|hostgroup|service|servicegroup|user|usergroup)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor brightgreen "object[ \t]+(checkcommand|notificationcommand|eventcommand|notification)"
|
|
|
|
icolor brightgreen "object[ \t]+(timeperiod|scheduleddowntime|dependency|perfdatawriter)"
|
|
|
|
icolor brightgreen "object[ \t]+(graphitewriter|idomysqlconnection|idomysqlconnection)"
|
|
|
|
icolor brightgreen "object[ \t]+(livestatuslistener|statusdatawriter|externalcommandlistener)"
|
|
|
|
icolor brightgreen "object[ \t]+(compatlogger|checkresultreader|checkcomponent|notificationcomponent)"
|
|
|
|
icolor brightgreen "object[ \t]+(filelogger|sysloglogger|icingastatuswriter|apilistener|endpoint|zone)"
|
|
|
|
|
|
|
|
## apply def
|
|
|
|
icolor brightgreen "apply[ \t]+(Service|Dependency|Notification|ScheduledDowntime)"
|
|
|
|
|
|
|
|
|
|
|
|
## objects attributes
|
2014-11-17 09:51:24 +01:00
|
|
|
icolor red "(^|^\s+)(accept_commands|accept_config|action_url|address|address6|arguments|author|bind_host)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor red "(^|^\s+)(bind_port|ca_path|categories|cert_path|check_command|check_interval)"
|
2014-11-17 09:51:24 +01:00
|
|
|
icolor red "(^|^\s+)(check_period|child_host_name|child_service_name|cleanup|command|command_endpoint|command_path)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor red "(^|^\s+)(comment|compat_log_path|crl_path|database|disable_checks|disable_notifications)"
|
|
|
|
icolor red "(^|^\s+)(display_name|duration|email|enable_active_checks|enable_event_handler)"
|
2014-08-28 21:15:57 +02:00
|
|
|
icolor red "(^|^\s+)(enable_flapping|enable_ha|enable_notifications|enable_passive_checks|enable_perfdata)"
|
|
|
|
icolor red "(^|^\s+)(endpoints|env|event_command|failover_timeout|fixed|flapping_threshold|groups|host)"
|
2014-10-11 20:38:24 +02:00
|
|
|
icolor red "(^|^\s+)(host_format_template|host_name|host_name_template|host_perfdata_path|host_temp_path|icon_image)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor red "(^|^\s+)(icon_image_alt|instance_description|instance_name|interval|key_path|log_dir)"
|
|
|
|
icolor red "(^|^\s+)(log_duration|max_check_attempts|methods|name|notes|notes_url|objects_path)"
|
|
|
|
icolor red "(^|^\s+)(pager|parent|parent_host_name|parent_service_name|password|path|period)"
|
|
|
|
icolor red "(^|^\s+)(port|ranges|retry_interval|rotation_interval|rotation_method)"
|
2014-10-11 20:38:24 +02:00
|
|
|
icolor red "(^|^\s+)(service_format_template|service_name|service_name_template|service_perfdata_path|service_temp_path)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor red "(^|^\s+)(severity|socket_path|socket_type|spool_dir|states|status_path|table_prefix)"
|
2014-11-17 09:51:24 +01:00
|
|
|
icolor red "(^|^\s+)(timeout|times|types|update_interval|user|user_groups|users|volatile|zone)"
|
2014-06-03 22:45:24 +02:00
|
|
|
icolor red "(^|^\s+)(vars\.\w+)"
|
|
|
|
|
|
|
|
|
|
|
|
## keywords
|
2015-03-16 09:59:26 +01:00
|
|
|
icolor red "(^|^\s+)|(icinga2Keyword|template|const|import|include|include_recursive|var|function|return|to|use|locals|globals|this)\s+"
|
2014-06-03 22:45:24 +02:00
|
|
|
|
|
|
|
## Assign conditions
|
|
|
|
icolor magenta "(assign|ignone)[ \t]+where"
|
|
|
|
|
2015-03-12 16:10:15 +01:00
|
|
|
## Global functions
|
|
|
|
icolor white "(regex|match|len|union|intersection|keys|string|number|bool|random|log|typeof|get_time|exit)"
|
|
|
|
|
|
|
|
## Accessor Functions
|
|
|
|
icolor white "(get_host|get_service|get_user|get_check_command|get_event_command|get_notification_command)"
|
|
|
|
icolor white "(get_host_group|get_service_group|get_user_group|get_time_period)"
|
|
|
|
|
|
|
|
|
|
|
|
## Math functions
|
|
|
|
icolor white "(Math.E|Math.LN2|Math.LN10|Math.LOG2E|Math.PI|Math.SQRT1_2|Math.SQRT2)"
|
|
|
|
icolor white "(Math.abs|Math.acos|Math.asin|Math.atan|Math.atan2|Math.ceil|Math.cos)"
|
|
|
|
icolor white "(Math.exp|Math.floor|Math.isinf|Math.isnan|Math.log|Math.max|Math.min)"
|
|
|
|
icolor white "(Math.pow|Math.random|Math.round|Math.sign|Math.sin|Math.sqrt|Math.tan)"
|
|
|
|
|
|
|
|
## Json functions
|
|
|
|
icolor white "(Json.encode|Json.decode)"
|
|
|
|
|
|
|
|
## String functions
|
|
|
|
icolor white "(\.to_string)"
|
|
|
|
icolor white "(\.find)"
|
|
|
|
icolor white "(\.contains)"
|
|
|
|
icolor white "(\.len)"
|
|
|
|
icolor white "(\.lower)"
|
|
|
|
icolor white "(\.upper)"
|
|
|
|
icolor white "(\.replace)"
|
|
|
|
icolor white "(\.split)"
|
|
|
|
icolor white "(\.substr)"
|
|
|
|
|
|
|
|
## Array and Dict Functions
|
|
|
|
icolor white "(\.add)"
|
|
|
|
icolor white "(\.clear)"
|
|
|
|
icolor white "(\.clone)"
|
|
|
|
icolor white "(\.contains)"
|
|
|
|
icolor white "(\.len)"
|
|
|
|
icolor white "(\.remove)"
|
|
|
|
icolor white "(\.set)"
|
|
|
|
icolor white "(\.remove)"
|
|
|
|
icolor white "(\.sort)"
|
|
|
|
icolor white "(\.join)"
|
|
|
|
icolor white "(\.clone)"
|
|
|
|
icolor white "(\.call)"
|
|
|
|
icolor white "(\.callv)"
|
|
|
|
|
|
|
|
|
|
|
|
## Conditional statements
|
|
|
|
icolor white "(if|else)"
|
|
|
|
|
|
|
|
## Loops
|
|
|
|
icolor white "(while|for|break|continue)"
|
|
|
|
|
|
|
|
## Operators
|
|
|
|
icolor green "\s(\.)\s"
|
|
|
|
icolor green "\s(!)\s"
|
|
|
|
icolor green "\s(\~)\s"
|
|
|
|
icolor green "\s(\+)\s"
|
|
|
|
icolor green "\s(-)\s"
|
|
|
|
icolor green "\s(\*)\s"
|
|
|
|
icolor green "\s(/)\s"
|
|
|
|
icolor green "\s(%)\s"
|
|
|
|
icolor green "\s(=)\s"
|
|
|
|
icolor green "\s(<)\s"
|
|
|
|
icolor green "\s(>)\s"
|
|
|
|
icolor green "\s(<<)\s"
|
|
|
|
icolor green "\s(>>)\s"
|
|
|
|
icolor green "\s(<=)\s"
|
|
|
|
icolor green "\s(>=)\s"
|
|
|
|
icolor green "\s(in)\s"
|
|
|
|
icolor green "\s(!in)\s"
|
|
|
|
icolor green "\s(==)\s"
|
|
|
|
icolor green "\s(!=)\s"
|
|
|
|
icolor green "\s(&)\s"
|
|
|
|
icolor green "\s(\^)\s"
|
|
|
|
icolor green "\s(|)\s"
|
|
|
|
icolor green "\s(&&)\s"
|
|
|
|
icolor green "\s(||)\s"
|
|
|
|
icolor green "\s(=>)\s"
|
|
|
|
icolor green "\s(\+=)\s"
|
|
|
|
icolor green "\s(-=)\s"
|
|
|
|
icolor green "\s(\*=)\s"
|
|
|
|
icolor green "\s(/=)\s"
|
|
|
|
|
|
|
|
## Global constats
|
|
|
|
icolor yellow "(PrefixDir|SysconfDir|ZonesDir|LocalStateDir|RunDir|PkgDataDir|StatePath|ObjectsPath)"
|
|
|
|
icolor yellow "(PidPath|NodeName|ApplicationType|EnableNotifications|EnableEventHandlers|EnableFlapping)"
|
|
|
|
icolor yellow "(EnableHostChecks|EnableServiceChecks|EnablePerfdata|UseVfork|RunAsUser|RunAsGroup|PluginDir)"
|
|
|
|
icolor yellow "(Vars\s+)"
|
2014-06-03 22:45:24 +02:00
|
|
|
|
|
|
|
## Boolean
|
|
|
|
icolor blue "(true|false)"
|
|
|
|
|
|
|
|
# Null
|
|
|
|
icolor blue "(null)"
|
|
|
|
|
|
|
|
|
|
|
|
## comments
|
|
|
|
color brightblue "\/\/.*"
|
|
|
|
color brightblue "^[ \t]*\*\($\|[ \t]\+\)"
|
|
|
|
color brightblue start="/\*" end="\*/"
|
|
|
|
|
|
|
|
## Braces and Parens definition
|
|
|
|
# - Braces are used in dictionary definition
|
|
|
|
|
2015-03-12 16:10:15 +01:00
|
|
|
color magenta "(\(|\))"
|
|
|
|
color magenta "(\[|\])"
|
|
|
|
color magenta "(\{|\})"
|
2014-06-03 22:45:24 +02:00
|
|
|
|
|
|
|
## type definitions
|
|
|
|
# - double quotes "
|
|
|
|
# - single quotes '
|
|
|
|
# - brackets <>
|
|
|
|
|
2015-03-12 16:10:15 +01:00
|
|
|
color brightyellow "'"
|
|
|
|
color brightyellow """
|
2014-06-03 22:45:24 +02:00
|
|
|
color brightyellow start="<" end=">"
|