]> gitweb.michael.orlitzky.com - nagios-mode.git/blob - README
Add a newline.
[nagios-mode.git] / README
1 1. What
2
3 Nagios-mode is an Emacs mode for editing Nagios[1] configuration
4 files. You probably already know that, or you wouldn't be reading
5 this. But maybe you just love Emacs, and you go around looking for
6 things that end in -mode. Then you README them.
7
8 So, Nagios is monitoring software that is configured via plain-text
9 (*.cfg) files. They have a C-like syntax, and a bunch of special
10 keywords. Nagios mode will apply syntax highlighting to these
11 configuration files, possibly alerting you to the fact that you have
12 done something stupid. Moreover, the buffers will look prettier.
13
14 [1] http://www.nagios.org/
15
16
17 2. Where
18
19 Stick nagios-mode.el somewhere, and add that place to your Emacs load
20 path. For example,
21
22 (setq load-path
23 (append (list "~/.home/emacs/modes/nagios-mode/")
24 load-path))
25
26 is how I do it. With that in your load path, you just have to add
27 nagios-mode to your auto-load list,
28
29 (autoload 'nagios-mode "nagios-mode" nil t)
30
31 And tell Emacs to use it automatically when editing *.cfg files,
32
33 (setq auto-mode-alist
34 (append (list '("\\.cfg$" . nagios-mode))
35 auto-mode-alist))
36
37 which is great as long as you don't have other *.cfg files with a
38 different syntax. That case is left as an exercise for the reader.
39
40
41 3. How
42
43 The macros and object definitions are parsed from the Nagios source
44 code. Object definitions are found within xdata/xodtemplate.h, while
45 the macros are cleverly hidden within include/macros.h. Once they have
46 been parsed, they are cuth and pasteth in to nagios-mode.
47
48 The directives (or variables) are another story. There is no obvious
49 way to parse the object variables from the source code. So, it's done
50 the old-fashioned way: I use nagios-mode until I notice that one of my
51 variables isn't highlighted. Then I add it. You can mail me these and
52 I will probably add them.
53
54
55 4. When
56
57 No seriously, I'm running out of words to use as headings. Send bug
58 reports and feature requests to michael@orlitzky.com.