I am trying to move our Pre-existing PRTG setup to a Nagios setup. The problem is that we currently have over 20k monitors, and so i'm trying to export the sensor information out of the .dat file and into a readable file that can be moved into a number of other nagios files. The problem is, I'm still very new to scripting and aside from creating a script that can split up the file so that bash doesn't kill itself, all attempts have failed. I tried to use a script someone else had written, but i don't think it will work for what I need it to.
I am needing to extract the following information Everything between host***/host and name***/name
If someone could at least point me in the direction where I could figure out how to write something that would allow me to extract a range of text, that would work as well. :)
Example:
<host> 10.0.0.0 </host> <name> This is a Business </name>
Keep in mind this config file I am using is a .dat file that is almost a gig in size.
<?xml version="1.0" encoding="UTF-8"?> <root version="15" oct="PRTG Network Monitor 17.2.31.1917 x64" saved="5/12/2017 4:36:26 PM" max="184692" guid="{3A6843F2-61BB-47EA-8EB2- B2E62E24EF2F}" treeversion="0" created="2009-10-02-19-22-11" <statistics time="12-05-2017 16:09:19">