Page 2 of 2
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 12:25 pm
by ahoward12
This is what you're trying to achieve, correct? (Picture)
I actually even found the article I used here
https://support.nagios.com/kb/article.php?id=478
I am no expert, just trying to help out. I'll answer any questions I can! Similar to your hostchecks, what does your servicechecks look like?
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 2:07 pm
by cdienger
Thanks for pointing the KB out. rexconsulting, can you confirm with a screenshot of the gui what you're seeing and what you'd liked changed?
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 3:25 pm
by ahoward12
If that picture is your end goal, it should do it. Here are copies of my checks just as a cross reference. Our hostchecks are identical..
Code: Select all
mysql> describe nagios_hostchecks;
+-----------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------------------+----------------+
| hostcheck_id | int(11) | NO | PRI | NULL | auto_increment |
| instance_id | smallint(6) | NO | MUL | 0 | |
| host_object_id | int(11) | NO | | 0 | |
| check_type | smallint(6) | NO | | 0 | |
| is_raw_check | smallint(6) | NO | | 0 | |
| current_check_attempt | smallint(6) | NO | | 0 | |
| max_check_attempts | smallint(6) | NO | | 0 | |
| state | smallint(6) | NO | | 0 | |
| state_type | smallint(6) | NO | | 0 | |
| start_time | datetime | NO | | 0000-00-00 00:00:00 | |
| start_time_usec | int(11) | NO | | 0 | |
| end_time | datetime | NO | | 0000-00-00 00:00:00 | |
| end_time_usec | int(11) | NO | | 0 | |
| command_object_id | int(11) | NO | | 0 | |
| command_args | varchar(255) | NO | | | |
| command_line | varchar(255) | NO | | | |
| timeout | smallint(6) | NO | | 0 | |
| early_timeout | smallint(6) | NO | | 0 | |
| execution_time | double | NO | | 0 | |
| latency | double | NO | | 0 | |
| return_code | smallint(6) | NO | | 0 | |
| output | mediumtext | NO | | NULL | |
| long_output | mediumtext | NO | | NULL | |
| perfdata | mediumtext | NO | | NULL | |
+-----------------------+--------------+------+-----+---------------------+----------------+
24 rows in set (0.00 sec)
mysql> describe nagios_servicechecks;
+-----------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------------------+----------------+
| servicecheck_id | int(11) | NO | PRI | NULL | auto_increment |
| instance_id | smallint(6) | NO | MUL | 0 | |
| service_object_id | int(11) | NO | MUL | 0 | |
| check_type | smallint(6) | NO | | 0 | |
| current_check_attempt | smallint(6) | NO | | 0 | |
| max_check_attempts | smallint(6) | NO | | 0 | |
| state | smallint(6) | NO | | 0 | |
| state_type | smallint(6) | NO | | 0 | |
| start_time | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| start_time_usec | int(11) | NO | | 0 | |
| end_time | datetime | NO | | 0000-00-00 00:00:00 | |
| end_time_usec | int(11) | NO | | 0 | |
| command_object_id | int(11) | NO | | 0 | |
| command_args | varchar(255) | NO | | | |
| command_line | varchar(255) | NO | | | |
| timeout | smallint(6) | NO | | 0 | |
| early_timeout | smallint(6) | NO | | 0 | |
| execution_time | double | NO | | 0 | |
| latency | double | NO | | 0 | |
| return_code | smallint(6) | NO | | 0 | |
| output | mediumtext | NO | | NULL | |
| long_output | mediumtext | NO | | NULL | |
| perfdata | mediumtext | NO | | NULL | |
+-----------------------+--------------+------+-----+---------------------+----------------+
23 rows in set (0.00 sec)
mysql> describe nagios_hoststatus;
+-------------------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------+--------------+------+-----+---------------------+----------------+
| hoststatus_id | int(11) | NO | PRI | NULL | auto_increment |
| instance_id | smallint(6) | NO | MUL | 0 | |
| host_object_id | int(11) | NO | UNI | 0 | |
| status_update_time | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| output | mediumtext | NO | | NULL | |
| long_output | mediumtext | NO | | NULL | |
| perfdata | mediumtext | NO | | NULL | |
| current_state | smallint(6) | NO | MUL | 0 | |
| has_been_checked | smallint(6) | NO | | 0 | |
| should_be_scheduled | smallint(6) | NO | | 0 | |
| current_check_attempt | smallint(6) | NO | | 0 | |
| max_check_attempts | smallint(6) | NO | | 0 | |
| last_check | datetime | NO | | 0000-00-00 00:00:00 | |
| next_check | datetime | NO | | 0000-00-00 00:00:00 | |
| check_type | smallint(6) | NO | MUL | 0 | |
| last_state_change | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| last_hard_state_change | datetime | NO | | 0000-00-00 00:00:00 | |
| last_hard_state | smallint(6) | NO | | 0 | |
| last_time_up | datetime | NO | | 0000-00-00 00:00:00 | |
| last_time_down | datetime | NO | | 0000-00-00 00:00:00 | |
| last_time_unreachable | datetime | NO | | 0000-00-00 00:00:00 | |
| state_type | smallint(6) | NO | MUL | 0 | |
| last_notification | datetime | NO | | 0000-00-00 00:00:00 | |
| next_notification | datetime | NO | | 0000-00-00 00:00:00 | |
| no_more_notifications | smallint(6) | NO | | 0 | |
| notifications_enabled | smallint(6) | NO | MUL | 0 | |
| problem_has_been_acknowledged | smallint(6) | NO | MUL | 0 | |
| acknowledgement_type | smallint(6) | NO | | 0 | |
| current_notification_number | smallint(6) | NO | | 0 | |
| passive_checks_enabled | smallint(6) | NO | MUL | 0 | |
| active_checks_enabled | smallint(6) | NO | MUL | 0 | |
| event_handler_enabled | smallint(6) | NO | MUL | 0 | |
| flap_detection_enabled | smallint(6) | NO | MUL | 0 | |
| is_flapping | smallint(6) | NO | MUL | 0 | |
| percent_state_change | double | NO | MUL | 0 | |
| latency | double | NO | MUL | 0 | |
| execution_time | double | NO | MUL | 0 | |
| scheduled_downtime_depth | smallint(6) | NO | MUL | 0 | |
| failure_prediction_enabled | smallint(6) | NO | | 0 | |
| process_performance_data | smallint(6) | NO | | 0 | |
| obsess_over_host | smallint(6) | NO | | 0 | |
| modified_host_attributes | int(11) | NO | | 0 | |
| event_handler | varchar(255) | NO | | | |
| check_command | varchar(255) | NO | | | |
| normal_check_interval | double | NO | | 0 | |
| retry_check_interval | double | NO | | 0 | |
| check_timeperiod_object_id | int(11) | NO | | 0 | |
+-------------------------------+--------------+------+-----+---------------------+----------------+
47 rows in set (0.00 sec)
mysql> describe nagios_servicestatus;
+-------------------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------+--------------+------+-----+---------------------+----------------+
| servicestatus_id | int(11) | NO | PRI | NULL | auto_increment |
| instance_id | smallint(6) | NO | MUL | 0 | |
| service_object_id | int(11) | NO | UNI | 0 | |
| status_update_time | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| output | mediumtext | NO | | NULL | |
| long_output | mediumtext | NO | | NULL | |
| perfdata | mediumtext | NO | | NULL | |
| current_state | smallint(6) | NO | MUL | 0 | |
| has_been_checked | smallint(6) | NO | | 0 | |
| should_be_scheduled | smallint(6) | NO | | 0 | |
| current_check_attempt | smallint(6) | NO | | 0 | |
| max_check_attempts | smallint(6) | NO | | 0 | |
| last_check | datetime | NO | | 0000-00-00 00:00:00 | |
| next_check | datetime | NO | | 0000-00-00 00:00:00 | |
| check_type | smallint(6) | NO | MUL | 0 | |
| last_state_change | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| last_hard_state_change | datetime | NO | | 0000-00-00 00:00:00 | |
| last_hard_state | smallint(6) | NO | | 0 | |
| last_time_ok | datetime | NO | | 0000-00-00 00:00:00 | |
| last_time_warning | datetime | NO | | 0000-00-00 00:00:00 | |
| last_time_unknown | datetime | NO | | 0000-00-00 00:00:00 | |
| last_time_critical | datetime | NO | | 0000-00-00 00:00:00 | |
| state_type | smallint(6) | NO | MUL | 0 | |
| last_notification | datetime | NO | | 0000-00-00 00:00:00 | |
| next_notification | datetime | NO | | 0000-00-00 00:00:00 | |
| no_more_notifications | smallint(6) | NO | | 0 | |
| notifications_enabled | smallint(6) | NO | MUL | 0 | |
| problem_has_been_acknowledged | smallint(6) | NO | MUL | 0 | |
| acknowledgement_type | smallint(6) | NO | | 0 | |
| current_notification_number | smallint(6) | NO | | 0 | |
| passive_checks_enabled | smallint(6) | NO | MUL | 0 | |
| active_checks_enabled | smallint(6) | NO | MUL | 0 | |
| event_handler_enabled | smallint(6) | NO | MUL | 0 | |
| flap_detection_enabled | smallint(6) | NO | MUL | 0 | |
| is_flapping | smallint(6) | NO | MUL | 0 | |
| percent_state_change | double | NO | MUL | 0 | |
| latency | double | NO | MUL | 0 | |
| execution_time | double | NO | MUL | 0 | |
| scheduled_downtime_depth | smallint(6) | NO | MUL | 0 | |
| failure_prediction_enabled | smallint(6) | NO | | 0 | |
| process_performance_data | smallint(6) | NO | | 0 | |
| obsess_over_service | smallint(6) | NO | | 0 | |
| modified_service_attributes | int(11) | NO | | 0 | |
| event_handler | varchar(255) | NO | | | |
| check_command | varchar(255) | NO | | | |
| normal_check_interval | double | NO | | 0 | |
| retry_check_interval | double | NO | | 0 | |
| check_timeperiod_object_id | int(11) | NO | | 0 | |
+-------------------------------+--------------+------+-----+---------------------+----------------+
48 rows in set (0.00 sec)
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 3:59 pm
by cdienger
Thanks for for the screenshot and database details, Ahward12. Hopefully that helps get us in the right direction.
Re: status.php Status Information long output
Posted: Tue Apr 11, 2017 10:38 pm
by rexconsulting
OK so it's not the database schema; it's the code in status.php. I will take a look at what I can do to provide this screen with the API, as suggested. Many thanks for all the inputs.
CP
Re: status.php Status Information long output
Posted: Wed Apr 12, 2017 12:19 pm
by cdienger
Unless you can recall making some change to the status.php file, I don't think it would be anything in there. Are you sure you're looking at the correct database? Did you offload the database to a separate server at some point?
https://assets.nagios.com/downloads/nag ... Server.pdf covers offloading the server. If you want to PM a profile to us we can take a closer look at some of these things. Generate a profile under Admin > System Config > System Profile.