File: parse_files.py

package info (click to toggle)
pynag 0.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,196 kB
  • ctags: 1,181
  • sloc: python: 9,155; makefile: 200; sh: 151
file content (13 lines) | stat: -rwxr-xr-x 283 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python
import sys

## This is for the custom nagios module
sys.path.insert(1, '../')
from pynag.Parsers import config

## Create the plugin option
nc = config('/etc/nagios/nagios.cfg')
nc.parse()
#nc._post_parse()
for host in nc['all_host']:
    print nc.print_conf(host)