Page 1 of 2
status.php Status Information long output
Posted: Thu Mar 23, 2017 3:28 pm
by rexconsulting
Simple questions I am surprised I can't find here already discussed.
We want long output in the Status Information column in the status.php pages (Service Detail and the like). I know it may end up "not pretty" that way but that's what we want for this particular screen.
thanks!
CP
Re: status.php Status Information long output
Posted: Thu Mar 23, 2017 3:47 pm
by avandemore
Can you describe what you mean by "long output"? The page already supports multi-line output.
Re: status.php Status Information long output
Posted: Wed Mar 29, 2017 2:13 am
by rexconsulting
What I mean in the "Home->Details->Service Detail" listing, the "Status Information" column only shows the first line of output. If I click the link to get the status details of the check, I get all lines, but on the ""Home->Details->Service Detail" listing, I only see the first line.
Re: status.php Status Information long output
Posted: Wed Mar 29, 2017 8:58 am
by avandemore
I'm not aware of any supported method to do this. You may have better luck constructing your own custom page using the data pulled from the API. Information about the API can be found at XI > Help > REST API Docs. Another option is the JSON query interface located at: http://<Your Nagios>/nagios/jsonquery.html
Re: status.php Status Information long output
Posted: Mon Apr 03, 2017 10:27 am
by ahoward12
I faced this same issue some time back. The filed is defaulted to 256 characters I think, and this will solve your issue. At the end of each line be aware I used the default credentials, be sure to use yours instead. Run these in an SSH or CLI on your Nagios box.
Code: Select all
echo "use nagios;alter table nagios_servicestatus modify output varchar(65535) not null;alter table nagios_servicestatus modify long_output varchar(65535) not null;alter table nagios_servicestatus modify perfdata varchar(65535) not null;" | mysql -pnagiosxi
echo "use nagios;alter table nagios_hoststatus modify output varchar(65535) not null;alter table nagios_hoststatus modify long_output varchar(65535) not null;alter table nagios_hoststatus modify perfdata varchar(65535) not null;" | mysql -pnagiosxi
echo "use nagios;alter table nagios_servicechecks modify output varchar(65535) not null;alter table nagios_servicechecks modify long_output varchar(65535) not null;alter table nagios_servicechecks modify perfdata varchar(65535) not null;" | mysql -pnagiosxi
echo "use nagios;alter table nagios_hostchecks modify output varchar(65535) not null;alter table nagios_hostchecks modify long_output varchar(65535) not null;alter table nagios_hostchecks modify perfdata varchar(65535) not null;" | mysql -pnagiosxi
Re: status.php Status Information long output
Posted: Mon Apr 03, 2017 11:01 am
by cdienger
Hi rexconsulting, Have you had a chance to try ahoward12's or avandemore's suggestion?
Re: status.php Status Information long output
Posted: Tue Apr 04, 2017 1:09 am
by rexconsulting
Thanks ahoward12, avandemore, cdienger for the feedback. I am going to try.
I am going to get back to you this week on this. I am slow to respond to this thread, I know. It's not a super high priority issue; but definitely one worth having options and solutions for. So sorry about the delay and pls gimme 2-3 more days and I'll post again with something meaningful.
Thanks,
CP
Re: status.php Status Information long output
Posted: Tue Apr 04, 2017 9:00 am
by cdienger
No problem. Let us know as soon as you have something : )
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 1:21 am
by rexconsulting
I tried the "alter table" suggested by "ahoward12" (almost) and it didn't work but I just realized I did not run the commands exactly according to the instructions. Ahoward12, you do not specify which user to run it as. I ran it as root, which I am guessing should not matter (?)
The alters seem to have worked:
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 | |
+-----------------------+--------------+------+-----+---------------------+----------------+
So wondering, ahoward12, if there is any other change you made? Or did me running this as root make a difference that matters?
Many thanks!
CP
Re: status.php Status Information long output
Posted: Thu Apr 06, 2017 9:28 am
by cdienger
I imagine that you would want to be root to run the commands. That said, the type for output is mediumtext which should allow over 16M bytes. Unless ahoward12 meant to modify some other column, I would suggest looking into the API or JSON options avandemore suggested.