Scripted API Business Service Monitoring Adds/Updates

Hi all,

I’ve got about 5000-7000 nodes to add to various different BSM levels and clearly doing this via the web interface is going to be painful.

I’ve tried several times to do it from command line via curl to the API but have failed every time. It doesn’t error, it just doesn’t do anything to update the BSM config. I’ve scoured the documentation for information on it but it leaves a lot to be desired, unfortunately.

Has anyone managed to do this before and get it to work? Any handy scripts someone might have for interacting with the BSM API?

We are currently running v25, too, and are working toward v27 upgrades very soon but this work is more pressing than upgrading.

Any helpful tips or assistance in getting it working would be appreciated.

As far I remember, Jesse did an example how to create Business Services using the REST API which might be a good starting point: GitHub - OpenNMS/bsm-virtual-server-example: Model a virtual server using the BSM APIs

That helped me greatly.

What was slowing me down before was there’s no mention in the developer docs that the API for BSM will accept JSON over XML as it only talks about XML. But that’s probably on me too for not trying other things.