<div dir="ltr">Perhaps something like this?<br><div><br></div><div><div>C:\>set TEST=^<setting name="hostname" value="servername.companyname" /^></div><div>C:\>for /f "tokens=1,2,3 delims=/=" %a in ("%TEST%") do set HNa=%~c && set HN=%HNa:"=%</div><div>C:\>echo %HN%<br></div><div>servername.companyname</div></div><div><br></div><div>J</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 10 February 2015 at 11:27, John Tullis <span dir="ltr"><<a href="mailto:john@executech.com" target="_blank">john@executech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am managing a XYMON server of about 500 servers across different locations and networks. We've made the setup work well but I'm not starting to experiment with externals scripts. Because our network is so spread out, we have configured each host to have a unique hostname set up in the config file on each host using the pattern: servername.companyname.  This isn't an issue until I need to feed the hostname back to the server in a custom script. Is there anything in bbwin.exe that will let me query for the hostname set in the .\etc\bbwin.cfg file and spit it out somewhere?<br>
<br>
I've also found a way to use findstr to look for the hostname line in the file but am having trouble using batch to remove everything from the line than just the hostname. It's returning  <setting name="hostname" value="servername.companyname" /> but I don't have enough experience to narrow it down any further than that (primarily through batch files).<br>
<br>
Any advice would be extremely helpful.<br>
<br>
Thanks,<br>
<br>
John<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div><br></div>