NagiosXI :: Contacts and users issue
Posted: Mon Jun 14, 2021 7:40 am
Hi ,
I tried to setup users (with monitoring contacts) and trying to give read only access to only few process checks following below link
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
For example -
say user1 mapped to contact1 and contactgroup1 have contact1 .
Mapped contactgroup1 to hosts & services which I need to provide read-only access to user1.
When logged in with user1 in another browser, he can't see any services & hosts that are mapped to.
Note: I have implemented above in couple of other projects which worked like breeze, but for current new project struggling to setup as per requirement.
Tried below points already.
* executed repair scripts (repairmysql.sh and repair_databases.sh)
* tried checking nagios.log - no errors found
* found below errors in /var/log/messages while executing "apply configuration" - not sure if this could be related
Jun 14 15:08:17 mon01 ndo2db: Error: mysql_query() failed for 'DELETE FROM nagios_contacts WHERE instance_id='1''
Jun 14 15:08:17 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='4242', alias='XXXXXX', email_address='XXXXXXX', pager_address='', host_timeperiod_object_id='4241', service_timeperiod_object_id='4241', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='4242', alias='XXXXXXXXX', email_address='XXXXX', pager_address='', host_timeperiod_object_id='4241', service_timeperiod_object_id='4241', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='262', alias='Nagios Administrator', email_address='XXXXXX', pager_address='', host_timeperiod_object_id='229', service_timeperiod_object_id='229', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='0', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='0', notify_host_flapping='1', notify_host_downtime='0', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='262', alias='Nagios Administrator', email_address='XXXXX', pager_address='', host_timeperiod_object_id='229', service_timeperiod_object_id='229', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='0', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='0', notify_host_flapping='1', notify_host_downtime='0', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='4234', alias='XXXXXX', email_address='XXXXXX', pager_address='', host_timeperiod_object_id='4233', service_timeperiod_object_id='4233', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='4234', alias='XXXXX', email_address='XXXXX', pager_address='', host_timeperiod_object_id='4233', service_timeperiod_object_id='4233', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='266', alias='Default Contact', email_address='root@localhost', pager_address='', host_timeperiod_object_id='246', service_timeperiod_object_id='246', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='266', alias='Default Contact', email_address='root@localhost', pager_address='', host_timeperiod_object_id='246', service_timeperiod_object_id='246', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
* I have contacts.cfg file without any issues which is listed in the nagios.cfg file as well
* why would nagios complain about "mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'"
* Why mysql_error looks for files ? ideally MySQL should complain about tables right ?
* why nagios trying to delete instance id 1 " Error: mysql_query() failed for 'DELETE FROM nagios_contacts WHERE instance_id='1''"
After troubleshooting for 3-4 hours, still couldn't fix the issue , thought of seeking help from forum.
Please help to advise fix for above.
Reading many other posts mostly it will be gone by repair MySQL but in my case this was not fixed.
I tried to setup users (with monitoring contacts) and trying to give read only access to only few process checks following below link
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
For example -
say user1 mapped to contact1 and contactgroup1 have contact1 .
Mapped contactgroup1 to hosts & services which I need to provide read-only access to user1.
When logged in with user1 in another browser, he can't see any services & hosts that are mapped to.
Note: I have implemented above in couple of other projects which worked like breeze, but for current new project struggling to setup as per requirement.
Tried below points already.
* executed repair scripts (repairmysql.sh and repair_databases.sh)
* tried checking nagios.log - no errors found
* found below errors in /var/log/messages while executing "apply configuration" - not sure if this could be related
Jun 14 15:08:17 mon01 ndo2db: Error: mysql_query() failed for 'DELETE FROM nagios_contacts WHERE instance_id='1''
Jun 14 15:08:17 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='4242', alias='XXXXXX', email_address='XXXXXXX', pager_address='', host_timeperiod_object_id='4241', service_timeperiod_object_id='4241', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='4242', alias='XXXXXXXXX', email_address='XXXXX', pager_address='', host_timeperiod_object_id='4241', service_timeperiod_object_id='4241', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='262', alias='Nagios Administrator', email_address='XXXXXX', pager_address='', host_timeperiod_object_id='229', service_timeperiod_object_id='229', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='0', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='0', notify_host_flapping='1', notify_host_downtime='0', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='262', alias='Nagios Administrator', email_address='XXXXX', pager_address='', host_timeperiod_object_id='229', service_timeperiod_object_id='229', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='0', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='0', notify_host_flapping='1', notify_host_downtime='0', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='4234', alias='XXXXXX', email_address='XXXXXX', pager_address='', host_timeperiod_object_id='4233', service_timeperiod_object_id='4233', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='4234', alias='XXXXX', email_address='XXXXX', pager_address='', host_timeperiod_object_id='4233', service_timeperiod_object_id='4233', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='1', notify_service_warning='1', notify_service_unknown='1', notify_service_critical='1', notify_service_flapping='1', notify_service_downtime='1', notify_host_recovery='1', notify_host_down='1', notify_host_unreachable='1', notify_host_flapping='1', notify_host_downtime='1', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
Jun 14 15:08:18 mon01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='266', alias='Default Contact', email_address='root@localhost', pager_address='', host_timeperiod_object_id='246', service_timeperiod_object_id='246', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='266', alias='Default Contact', email_address='root@localhost', pager_address='', host_timeperiod_object_id='246', service_timeperiod_object_id='246', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0''
Jun 14 15:08:18 mon01 ndo2db: mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'
* I have contacts.cfg file without any issues which is listed in the nagios.cfg file as well
* why would nagios complain about "mysql_error: 'Can't find file: 'nagios_contacts' (errno: 2)'"
* Why mysql_error looks for files ? ideally MySQL should complain about tables right ?
* why nagios trying to delete instance id 1 " Error: mysql_query() failed for 'DELETE FROM nagios_contacts WHERE instance_id='1''"
After troubleshooting for 3-4 hours, still couldn't fix the issue , thought of seeking help from forum.
Please help to advise fix for above.
Reading many other posts mostly it will be gone by repair MySQL but in my case this was not fixed.