status.php Status Information long output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

status.php Status Information long output

Post 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
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: status.php Status Information long output

Post by avandemore »

Can you describe what you mean by "long output"? The page already supports multi-line output.
Previous Nagios employee
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: status.php Status Information long output

Post 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.
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: status.php Status Information long output

Post 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
Previous Nagios employee
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: status.php Status Information long output

Post 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
Last edited by ahoward12 on Tue Apr 04, 2017 7:28 am, edited 1 time in total.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: status.php Status Information long output

Post by cdienger »

Hi rexconsulting, Have you had a chance to try ahoward12's or avandemore's suggestion?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: status.php Status Information long output

Post 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
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: status.php Status Information long output

Post by cdienger »

No problem. Let us know as soon as you have something : )
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: status.php Status Information long output

Post 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
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: status.php Status Information long output

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked