#!/usr/bin/python

import sys

sys.stdout.write("""#
# This file has been created by OMD out of the following files:
#
""")

for fn in sys.argv[1:]:
    sys.stdout.write("# %s\n" % fn)

sys.stdout.write("""#
# Do not edit this file. It will be recreated each time Nagios
# is started or reloaded. Rather change things in the original
# files.
# 
# ------------------------------------------------------------

""")

for fn in sys.argv[1:]:
    lineno = 0
    for line in file(fn):
	lineno += 1
	ls = line.strip()
	if ls == "" or ls.startswith("#"):
	    continue
	sys.stdout.write("# %s:%d\n" % (fn, lineno))
	sys.stdout.write(line)
