Page 1 of 1

duplicate entry; unknown time outs?

Posted: Wed May 19, 2021 12:33 pm
by seaward1983
Red Hat Enterprise Linux Server release 7.9 (Maipo)
x86_64
Manual install of XI -- running since 2019
Version of XI - Installed Version: 5.8.3
Attaching profile

I've added additional monitoring (bandwidth) for 5 servers in our environment. Two servers - I had mixed results. Three of the servers - fine/flawless. Two of them, though - went something like this:
  • Used NCPA - added the system - token - blah blah.
    It sat for an extended period of time - but finally came up with the objects available for monitoring
    Deselected everything but bond0 NICs
    Applied - get this error -- something to the effect of "Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted".
    When getting that error - I log into the server -- cd /usr/local/nagios/etc/import - and delete the temp file. Then cd /usr/local/nagiosxi/scripts - ran ./reconfigure_nagios.sh - and it came back clean.
    Went ahead in Nagios gui - "apply the configuration".... and the "apply the configuration" - and it works "without error".
    Looking at CCM>Monitoring>Services - the bandwidth services show "Active:Yes" "Status:Not Applied"
    Looking at Service>Status -- the services are there, and it's getting responses, gathering data - is there a switch that needs to be flipped in the database to show it's "applied"? I've tried de-activating it, and reactivating it - no joy; I've tried creating the service outside of the wizard - same thing. Maybe there is a time-out issue - because of how LONG it takes to get a response for the server?
Weird to note, too, when this happens -- all of the counters wig out for the particular server -- "wig out" - translates into all of the counters for the server go into an "unknown" state.

Re: duplicate entry; unknown time outs?

Posted: Thu May 20, 2021 11:53 am
by vtrac
Hi,
How are you doing?

Please open a Nagios XI command prompt and run the below command.
Please replace 'hostName' which contain the issue.

Code: Select all

echo "select * from nagios_objects where name1 = 'hostName';" | mysql -h 127.0.0.1 -uroot -pnagiosxi nagios --table
Now, please look at the "is_active" column ... "1" = active, "0" = not active.
Does that service says "0" or "1"?

Here's an example picture of my test:
Th1.png

Let's try and delete those config files and see what happens.
Nagios XI GUI > Core Config Manager > Tools > Config File Management
Click "Delete Files"
Click "Write Configs"
Click "Verify Files"
Now do "Apply Configuration"

Does that service still says "Active" and "Applied" now?

Please share screenshots, if possible ... :-)

Now, please run the "select" statement (above) again .... and upload screenshot, please.


Best Regards,
Vinh

Re: duplicate entry; unknown time outs?

Posted: Mon Jun 14, 2021 2:58 pm
by seaward1983
You can close this. No, didn't figure it out -- but found when I removed everything related to the host including the host, and add the whole thing back - it's fine. So I'll just delete everyone I need to do this on if necessary.

Re: duplicate entry; unknown time outs?

Posted: Mon Jun 14, 2021 3:18 pm
by vtrac
Hi,
I'm glad that you have figured out the solution for this issue ... :-)

Closing ticket!!


Regards,
Vinh