Extracting information from Config files /text processing
Hello All,
This is my first post on this forums, which I consider one of the best of its kind. The reason for my post is that I want to export some information form Nagios configuration files to a DB. I know that there are other tools available to do this, like NDO, monarch, etc... But I want to do it my self as I have different requests and I will like to improve my scripting capabilities
This is an example from hosts.cfg file:
I will like to know if there is a way to use a for loop that reads the text inside the { }'s, to define the first column inside it as a variable (or array in case of contact_groups, which has many comma separated values) and second column as value. It will also have to discard comments (# and ; lines)
Any suggestion is welcome, I already did some scripts that do the job using grep, sed and awk; reading line by line, but I think that there are other easier approaches that might improve the script, like reading text blocks instead of lines....
Dear friends,
I'm a novice Unix user and I'm trying to learn the ropes. I have a big task I have to accomplish and I'm convinced Unix can get the job done, I just haven't figured out how. I recently posted on the topic of cutting text between unique text patterns and somebody helped me a great... (24 Replies)
Hi ,
a:) i have configuration file with pattren
<Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output>
eg:
myfile.confg
9899000000,9899999999,DATA,b.dat
9899000000,9899999999,SMS,a.dat
b:) Stucture of my data file is... (3 Replies)
Hi,
I have to perform an iterative function on a set of 10 files. After the first round the output files are named differently than the input files.
examples
input file name = xxxx1.yyy
output file name = xxxx1_0001.yyy
I need to rename all of the output files to the original input... (5 Replies)
It would be highly appreciable if any one helps me in this. I am trying to get it done through Java but I love unix and believe it can be done within minutes with couple of lines.
The input log file is a text file contains multiple entries seperated by a blank line.
Each seperated entry... (7 Replies)
Hi All,
I have some HTML files and my requirement is to extract all the anchor text words from the HTML files along with their URLs and store the result in a separate text file separated by space. For example, <a href="/kid/stay_healthy/">Staying Healthy</a>
which has /kid/stay_healthy/ as... (3 Replies)
Hi all,
I have two .txt file i.e.
First text file:
2
4
1
4
Second text file
2 1.nii.gz
4 334.nii.gz
1 12.nii.gz
4 134.nii.gz
If entry in 1st column of 1st text file matches the 1st column of 2nd text file, then copy the file (name of which is the second column) associated with... (4 Replies)
Hi Everyone,
I'm really new to all this so I'm really hoping someone can help. I have a directory with ~1000 lists from which I want to extract lines from and write to new files. For simplicity lets say they are shopping lists and I want to write out the lines corresponding to apples to a new... (2 Replies)
i m unable to extract data from one text files to different text files..i am able to concat two text files in d same file
---------- Post updated at 03:21 PM ---------- Previous update was at 03:16 PM ----------
i want a c program for it (2 Replies)
Hello there,
I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies
LEARN ABOUT DEBIAN
icinga
icinga(8) nagios icinga(8)NAME
icinga - network/systems status monitoring daemon
SYNOPSIS
icinga [-h] [-v] [-s] [-d] <main_config_file>
DESCRIPTION
icinga is a daemon program that monitors the status of various network accessible systems, devices, and more. For more information, please
consult the online documentation available at http://www.icinga.org, or on your Icinga server's web page.
OPTIONS
main_config_file
The main configuration file. On debian systems this defaults to /etc/icinga/icinga.cfg
-h A helpful usage message
-v Reads all data in the configuration files and performs a basic verification/sanity check. Always make sure you verify your config
data before (re)starting Icinga.
-s Shows projected/recommended check scheduling information based on the current data in the configuration files.
-d Starts Icinga in daemon mode (instead of as a foreground process).
FILES
/etc/icinga
Default configuration directory for Icinga
AUTHOR
Icinga was started as Nagios by Ethan Galstad <nagios@nagios.org>. Icinga is maintained by the Icinga Project <info@icinga.org>. This
manual page was written by sean finney <seanius@debian.org> for the Debian GNU/Linux operating system (but it may be freely used, modified,
and redistributed by others).
sean finney March 2010 icinga(8)