NagiosXI host wizard - Bad Token (facepalm)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mike-d-howell
Posts: 11
Joined: Wed Feb 12, 2020 5:17 pm

NagiosXI host wizard - Bad Token (facepalm)

Post by mike-d-howell »

I wanted to pass along a facepalm moment in installing NCPA client on new Linux machines. Might save some people from a headache.

I installed the rpm successfully. I edited the ncpa.conf file with our production community_string under the [api] section. I could see the service starts and runs fine, could even netcat the port from other boxes. But when I would try to add the host in NagiosXI via the wizard, I would inevitably get a Bad Token error in the pink box. Even trying from a browser yielded Bad Token!

After checking obvious things like routing or firewall, I got back to first principles. The problem ultimately was that a default template community_string exists in the api section below a block of comments that I didn't see in my editor. So when I added my community_string=ABCDEFG right under [api], it was getting clobbered by the template community_string=SOMETHINGELSE that's in the config file by default. Once I removed the template community_string and restarted the service, my NCPA agent answered just fine. Nagios added the host no problem.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagiosXI host wizard - Bad Token (facepalm)

Post by scottwilkerson »

Welcome to the forum!

It's always the little things that can get us, thanks for sharing, we have all been there!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked