Automate BPI servicegroups and hostsgroups syncs
Posted: Wed Oct 07, 2015 9:23 pm
I've been trying to automate the bpi hostsgroups and servicehosts syncs within the bpi module.
I believe this maybe possible via a webinject.pl script that I can run in Xi or via a /usr/bin/perl crontab entry. I'm not achieving the desired result although my script finishing without issue. So either I'm missing something during login or not passing proper args. Any help or knowledge as to what the index.php is expecting would be great
like I mentioned, this seems to complete all transaction correctly but it doesn't actually update the bpi group syncs. I used HTTP Live headers to capture the HTTP traffic commands, this is what I filtered out to try.
here is my attempt of using webinject..pl cases
I added sleep to help troubleshoot
Any help would be great.
I believe this maybe possible via a webinject.pl script that I can run in Xi or via a /usr/bin/perl crontab entry. I'm not achieving the desired result although my script finishing without issue. So either I'm missing something during login or not passing proper args. Any help or knowledge as to what the index.php is expecting would be great
like I mentioned, this seems to complete all transaction correctly but it doesn't actually update the bpi group syncs. I used HTTP Live headers to capture the HTTP traffic commands, this is what I filtered out to try.
here is my attempt of using webinject..pl cases
Code: Select all
<testcases repeat="1">
<case
id="1"
method="get"
url="http://server.example.com/nagiosxi/login.php?redirect=/nagiosxi/admin/index.php%3f&noauth=1"
verifyresponsecode="200"
sleep="1"
/>
<case
id="2"
method="post"
url="http://server.example.com/nagiosxi/login.php"
postbody="nsp=cc483f1914b7e21c80f64054a69e4485&page=auth&debug=&pageopt=login&username=nagiosadmin&password=***********&loginButton=Login"
posttype="application/x-www-form-urlencoded"
verifypositive="Nagiosxi"
sleep="1"
/>
<case
id="3"
method="get"
url="http://server.example.com/nagiosxi/index.php"
verifyresponsecode="302"
sleep="1"
/>
<case
id="4"
method="get"
url="http://server.example.com/nagiosxi/includes/components/nagiosbpi/index.php?cmd=syncservicegroups"
verifyresponsecode="200"
sleep="5"
/>
<case
id="5"
method="get"in my last attempt, just in case
url="http://server.example.com/nagiosxi/includes/components/nagiosbpi/index.php?cmd=synchostgroups"
verifyresponsecode="200"
sleep="5"
/>
</testcases>
Any help would be great.