check_logfiles: 3.7.5.1
[omd.git] / packages / nagios / merge-nagios-config
blob5b5b5e3c31825a623371dfe47b7d31562e1c469b
1 #!/usr/bin/env python
3 import sys
5 sys.stdout.write("""#
6 # This file has been created by OMD out of the following files:
8 """)
10 for fn in sys.argv[1:]:
11 if fn.endswith('~'):
12 continue
13 sys.stdout.write("# %s\n" % fn)
15 sys.stdout.write("""#
16 # Do not edit this file. It will be recreated each time Nagios
17 # is started or reloaded. Rather change things in the original
18 # files.
20 # ------------------------------------------------------------
22 """)
24 for fn in sys.argv[1:]:
25 if fn.endswith('~'):
26 continue
27 lineno = 0
28 contline = ""
29 for line in file(fn):
30 lineno += 1
31 ls = line.strip()
32 if ls == "" or ls.startswith("#"):
33 continue
34 if ls[-1] == '\\':
35 contline += ls[:-1] + " "
36 continue
38 sys.stdout.write("# %s:%d\n" % (fn, lineno))
39 sys.stdout.write(contline + line)
40 contline = ""