Force overwrite on import of configurations

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Force overwrite on import of configurations

Post by WillemDH »

Hmmm experimented a bit with the api, but can't find a way to enable additive inheritance for contacts. Anyone an idea if this is possible yet? I tried putting a '+' before the contact but it doesn't seem to work.

curl -XPOST "https://srvnagios01.gentgrp.gent.be/nag ... y&pretty=1" -d "host_name=srvcon01&address=srvcon01&use=dig_windows_server_prio2&contacts=+nagiosadmin&notification_period=xi_timeperiod_24x7&force=1"


EDIT: Found it, it works with %2B
Last edited by WillemDH on Wed Jan 25, 2017 9:06 am, edited 1 time in total.
Nagios XI 5.8.1
https://outsideit.net
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Force overwrite on import of configurations

Post by BanditBBS »

WillemDH wrote:Hmmm experimented a bit with the api, but can't find a way to enable additive inheritance for contacts. Anyone an idea if this is possible yet? I tried putting a '+' before the contact but it doesn't seem to work.

curl -XPOST "https://srvnagios01.gentgrp.gent.be/nag ... y&pretty=1" -d "host_name=srvcon01&address=srvcon01&use=dig_windows_server_prio2&contacts=+nagiosadmin&notification_period=xi_timeperiod_24x7&force=1"
Instead of + use %2B and try again. Not 100% sure it's going to work, but have to html encode for sure.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Force overwrite on import of configurations

Post by WillemDH »

Just found it bandit. Tx! It works with %2B indeed
Nagios XI 5.8.1
https://outsideit.net
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Force overwrite on import of configurations

Post by BanditBBS »

WillemDH wrote:Just found it bandit. Tx! It works with %2B indeed
I use the heck out of this page: http://meyerweb.com/eric/tools/dencoder/

It just doesn't encode the ! which isn't an issue in this case, but is when I encode sql stuff. ! is %21 which I found here: http://www.w3schools.com/tags/ref_urlencode.asp
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Force overwrite on import of configurations

Post by WillemDH »

I'm using https://cyberchef.outsideit.net/ for that.

How would I create a passive service with stalking options o,w,c,u?

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Force overwrite on import of configurations

Post by rkennedy »

I read through the post, and it looks like there has been some work happening. I do see the mention of having a feature though Willem - would you like anything filed?

From what I read, I take it as a possible feature request to delete an existing host, and all services, and then overwrite 'cleanly' with the new config.
Former Nagios Employee
Locked