]>
Commit | Line | Data |
---|---|---|
781ed89b | 1 | " Vim syntax file |
222466ea ER |
2 | " Filename: nagios.vim |
3 | " Language: Nagios template object configuration file | |
4 | " Maintainer: Elan Ruusamäe <glen@pld-linux.org> | |
5 | " Author: Lance Albertson <ramereth@gentoo.org> | |
6 | " Author: Ava Arachne Jarvis <ajar@katanalynx.dyndns.org> | |
7 | " URL: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/nagios.vim | |
8 | " Version Info: $Revision$ | |
9 | " Last Change: $Date$ UTC | |
781ed89b ER |
10 | |
11 | if !exists("main_syntax") | |
12 | if version < 600 | |
13 | syntax clear | |
14 | elseif exists("b:current_syntax") | |
15 | finish | |
16 | endif | |
17 | ||
18 | let main_syntax = 'nagios' | |
19 | endif | |
20 | ||
21 | if version >= 600 | |
22 | setlocal iskeyword=_,-,A-Z,a-z,48-57 | |
23 | else | |
24 | endif | |
25 | ||
9ce1a5df ER |
26 | syn match nagiosLineComment '#.*' |
27 | syn match nagiosComment ';.*$' contained | |
781ed89b ER |
28 | |
29 | syn match nagiosConstant '\<[0-9]\+%\?\>' | |
30 | syn match nagiosConstant '\<[a-z]\>' | |
31 | ||
32 | syn region nagiosString start=+"+ end=+"+ contains=nagiosMacro | |
33 | syn region nagiosString start=+'+ end=+'+ contains=nagiosMacro | |
34 | ||
781ed89b ER |
35 | syn match nagiosDef 'define[ \t]\+\(\(host\|service\)extinfo\|host\|service\|timeperiod\|contact\|command\)' |
36 | syn match nagiosDef 'define[ \t]\+\(host\|contact\|service\)group' | |
37 | syn match nagiosDef 'define[ \t]\+\(service\|host\)dependency' | |
38 | syn match nagiosDef 'define[ \t]\+\(service\|host\|hostgroup\)escalation' | |
39 | ||
40 | syn match nagiosMacro '\$CONTACT\(NAME\|ALIAS\|EMAIL\|PAGER\)\$' | |
41 | syn match nagiosMacro '\$HOST\(NAME\|ALIAS\|ADDRESS\|STATE\|OUTPUT\|PERFDATA\|STATETYPE\|EXECUTIONTIME\)\$' | |
42 | syn match nagiosMacro '\$\(ARG\|USER\)\([1-9]\|[1-2][0-9]\|3[0-2]\)\$' | |
43 | syn match nagiosMacro '\$SERVICE\(DESC\|STATE\|OUTPUT\|PERFDATA\|LATENCY\|EXECUTIONTIME\|STATETYPE\)\$' | |
44 | syn match nagiosMacro '\$\(OUTPUT\|PERFDATA\|EXECUTIONTIME\|LATENCY\)\$' | |
45 | syn match nagiosMacro '\$NOTIFICATION\(TYPE\|NUMBER\)\$' | |
46 | syn match nagiosMacro '\$\(\(SHORT\|LONG\)\?DATETIME\|DATE\|TIME\|TIMET\)\$' | |
89eb3416 | 47 | syn match nagiosMacro '\$LASTSTATECHANGE\$' |
781ed89b ER |
48 | syn match nagiosMacro '\$ADMIN\(EMAIL\|PAGER\)\$' |
49 | syn match nagiosMacro '\$\(SERVICE\|HOST\)ATTEMPT\$' | |
50 | syn match nagiosMacro '\$LAST\(HOST\|SERVICE\)CHECK\$' | |
51 | ||
9ce1a5df ER |
52 | syn region nagiosDefBody start='{' end='}' |
53 | \ contains=nagiosComment,nagiosDirective,nagiosMacro,nagiosConstant,nagiosString,nagiosSpecial transparent | |
781ed89b | 54 | |
9ce1a5df ER |
55 | syn keyword nagiosDirective contained name register use |
56 | syn keyword nagiosDirective contained active_checks_enabled address alias check_command | |
57 | syn keyword nagiosDirective contained check_freshness check_period checks_enabled check_interval retry_interval | |
58 | syn keyword nagiosDirective contained command_line command_name | |
59 | syn keyword nagiosDirective contained contact_groups contact_name contactgroup_name | |
60 | syn keyword nagiosDirective contained dependent_host_name dependent_service_description | |
61 | syn keyword nagiosDirective contained email event_handler event_handler_enabled | |
62 | syn keyword nagiosDirective contained execution_failure_criteria first_notification execution_failure_options | |
63 | syn keyword nagiosDirective contained flap_detection_enabled freshness_threshold failure_prediction_enabled | |
64 | syn keyword nagiosDirective contained friday high_flap_threshold host_name | |
65 | syn keyword nagiosDirective contained host_notification_commands | |
66 | syn keyword nagiosDirective contained host_notification_options | |
67 | syn keyword nagiosDirective contained host_notification_period hostgroup_name servicegroup_name hostgroups servicegroups | |
68 | syn keyword nagiosDirective contained is_volatile last_notification | |
69 | syn keyword nagiosDirective contained low_flap_threshold max_check_attempts | |
70 | syn keyword nagiosDirective contained members monday normal_check_interval | |
71 | syn keyword nagiosDirective contained notification_failure_criteria notification_failure_options | |
72 | syn keyword nagiosDirective contained notification_interval notification_options | |
73 | syn keyword nagiosDirective contained notification_period notifications_enabled | |
74 | syn keyword nagiosDirective contained obsess_over_service pager parallelize_check | |
75 | syn keyword nagiosDirective contained parents passive_checks_enabled | |
76 | syn keyword nagiosDirective contained process_perf_data retain_nonstatus_information | |
77 | syn keyword nagiosDirective contained retain_status_information retry_check_interval | |
78 | syn keyword nagiosDirective contained saturday service_description | |
79 | syn keyword nagiosDirective contained service_notification_commands | |
80 | syn keyword nagiosDirective contained service_notification_options | |
81 | syn keyword nagiosDirective contained service_notification_period stalking_options | |
82 | syn keyword nagiosDirective contained sunday thursday timeperiod_name tuesday wednesday | |
83 | syn keyword nagiosDirective contained icon_image icon_image_alt vrml_image statusmap_image | |
84 | syn keyword nagiosDirective contained notes notes_url 2d_coords 3d_coords obsess_over_host inherits_parent | |
781ed89b ER |
85 | |
86 | hi link nagiosComment Comment | |
9ce1a5df | 87 | hi link nagiosLineComment Comment |
781ed89b ER |
88 | hi link nagiosConstant Number |
89 | hi link nagiosDef Statement | |
90 | hi link nagiosDirective Define | |
91 | hi link nagiosMacro Macro | |
92 | hi link nagiosString String | |
93 | hi link nagiosSpecial Special |