Page 1 of 1

Open file output with more then one line.

Posted: Thu May 10, 2018 6:40 am
by nms
Hi,

i have a file which contains more then one line entry. A Sample below:
cat sample.txt
Alarm Id : alarm85
Severity : Critical
Type : 6180.ProblemEvent
Topic : Tray.00.Drive.12
Event Code : 90.66.1025
Date : 2018-03-17 01:54:54
Device : am1da01[SUN.540654504.1137EH0009]
Description : Impending drive failure in Virtual Disk sms-edr-vd (Medium
Data Availability Risk), affected drive(s): Tray.00.Drive.12
State : Open
Acknowledged By : -
Auto Clear : Y
Aggregated Count : 0

Alarm Id : alarm89
Severity : Critical
Type : 6180.ProblemEvent
Topic : Tray.85.Drive.03
Event Code : 90.66.1025
Date : 2018-04-15 05:02:19
Device : am1da01[SUN.540654504.1137EH0009]
Description : Impending drive failure in Virtual Disk sms-vd (Medium Data
Availability Risk), affected drive(s): Tray.85.Drive.03
Tray.85.Drive.05 Tray.85.Drive.12
State : Open
Acknowledged By : -
Auto Clear : Y
Aggregated Count : 0
is this possible to make it all visible in the Nagios Status Information?

As per attached is seems it's limited . Is there a way to change the amount of length for output?

The aim is to have a simple script which counts the number of critical alarms. if for example the count is greater then 0 then i'll display this file in the status information.

Rgds,

Matthew

Re: Open file output with more then one line.

Posted: Thu May 10, 2018 8:20 am
by rkennedy
The data in your screenshot, appears to be the same text quoted - Nagios XI looks to be displaying the multi-lines properly, as it should.

Could you please clarify what you're looking for?

Re: Open file output with more then one line.

Posted: Thu May 10, 2018 8:34 am
by mcapra
I also do not see a difference in the two provided outputs.

That aside, this KB article has steps to prevent your status information from being cut-off after 256 characters if you are encountering that particular problem:
https://support.nagios.com/kb/article.php?id=478

Re: Open file output with more then one line.

Posted: Thu May 10, 2018 10:09 am
by nms
Hi,

Sorry maybe i wasn't clear enough. if you click on the overview then that's fine as it shows the multiple output.
What i mean is if all those lines can be displayed in the Status Information, being a non one liner output.
As you can see in the attached it just stops after certain Kb of data. I think there's a limitation for that somehow.

@mcapra, i already have the limitation set from being cut-off, so i guess there's an extra limitation somewhere for plugin output? or maybe the output should be represented in an other way?

Rgds,

Matthew

Re: Open file output with more then one line.

Posted: Thu May 10, 2018 10:15 am
by mcapra
In this case, there's 2 different macros Nagios Core uses to capture status output: $SERVICEOUTPUT$ and $LONGSERVICEOUTPUT$. There are also corresponding macros for host outputs. More info here:
https://assets.nagios.com/downloads/nag ... olist.html

I think the status overview is hard-wired to use $SERVICEOUTPUT$, which will only ever capture the first line of a status output. You'd have to make fundamental changes to the status overview pages to get what you're looking for. Perhaps a tech can confirm this?

Re: Open file output with more then one line.

Posted: Thu May 10, 2018 2:41 pm
by npolovenko
@nms, With what @mcapra said about using the correct macros, I think it's still not possible to display multiline output in the status overview. That is how the homepage component was built->it will only show the first line. I tried to achieve something similar not so long ago. With some tweaking, you could extend the status information to display all lines of output as a very long single line output.