check result max number of char
-
ahmad.zuhd
- Posts: 44
- Joined: Sun Jul 01, 2012 2:33 am
check result max number of char
I have may traps that generate long output result. due to the limitation in the Nagios Result output the trap output is trimmed. Is there a way to increase the maximum number of char in Nagios Service check output?
Re: check result max number of char
The UI has some limitations on the maximum display, though the max number of characters that are actually processed is quite large. How may lines/characters are we talking about here?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
ahmad.zuhd
- Posts: 44
- Joined: Sun Jul 01, 2012 2:33 am
Re: check result max number of char
well, most of the check results are limited in length, however with the existence of snmptt trap manipulation options, some traps contains a lot of information and a lot of variables in the trap. I don't have a sample now. but i need to know if the configuration can be changed to process that output and how that will affect the system performance.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check result max number of char
The hard character limit is 1024 for nagios xi and requires much work to extend it beyond that. As a side not altering that setting may not be supported. If you are not able to get the information out using $serviceoutput$ and $longserviceoutput$ you are likely being truncated before that.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
ahmad.zuhd
- Posts: 44
- Joined: Sun Jul 01, 2012 2:33 am
Re: check result max number of char
It seems that the limitation i have is on the notification string not the service output. For example i have the following two service alerts as in the Service Alert History:
While in the Service Notification i have the following Notification :
Service Warning[07-24-2013 11:14:10] SERVICE ALERT: smsc;SNMP Traps;WARNING;HARD;1;TrapName notagOpcomWarningTrap / trapNotificationId (INTEGER):3 trapSeverity (INTEGER):warning trapData (OCTETSTR):Message from user AUDIT9984ERVER on SMJL41 Security alarm (SECURITY) and security audit (SECURITY) on SMJL41, system id: 1306 Auditable event: System UAF record modification Event time: 24-JUL-2013 11:14:35.99 PID: 0006C93F Process name: TCPIP9984S_BG1198 Username: TCPIP9984SH Process owner: [TCPIPsmsc2UX,TCPIP9984SH] Image name: DSA0:[SYS0.SYSCOMMON.][SYSEXE]TCPIP9984SH_SSHD2.EXE Object class name: FILE Object name: SYSnagiosOMMON:[SYSEXE]SYSUAF.DAT:1 User record: SMSC Flags: New: DISFORCE Original: DISFORCE Login failures: New: 1 Original: 0 Posix UID: -2 Posix GID: -2 (%XFFFFFFFE) trapEntityName (OCTETSTR):OPCOM trapTimeStamp (OCTETSTR):24-JUL-2013 11:14:35.99 trapNodeName (OCTETSTR):SMJL41
Service Warning[07-24-2013 11:14:06] SERVICE ALERT: smsc;SNMP Traps;WARNING;HARD;1;TrapName unknownOpcomCriticalTrap / trapNotificationId (INTEGER):3 trapSeverity (INTEGER):warning trapData (OCTETSTR):Message from user AUDIT9991ERVER on SMJL41 Security alarm (SECURITY) and security audit (SECURITY) on SMJL41, system id: 1306 Auditable event: Network login failure Event time: 24-JUL-2013 11:14:36.04 PID: 0006C93F Process name: TCPIP9991S_BG1198 Username: SMSC Remote node fullname: SSH_PASSWORD:10.108.141.115 Remote username: SMSC(LOCAL) Status: %LOGIN-F-NOTVALID, user authorization failure trapEntityName (OCTETSTR):OPCOM trapTimeStamp (OCTETSTR):24-JUL-2013 11:14:36.04 trapNodeName (OCTETSTR):SMJL41
While in the Service Notification i have the following Notification :
so how i can change the max number of char in the notification, i think this is controlled by "$SERVICEOUTPUT$" and "$LONGSERVICEOUTPUT$"Date / Time Host Service Reason Escalated State Contact Dispatcher Information IDs
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2013-07-24 11:14:10 smsc SNMP Traps Service Problem No WARNING imad.sulaiman Nagios XI TrapName notagOpcomWarningTrap / trapNotificationId (INTEGER):3 trapSeverity (INTEGER):warning trapData (OCTETSTR):Message from user AUDIT9984ERVER on SMJL41 Security alarm (SECURITY) and security audit (SECURITY) on SMJL41, system id: 1306 Auditable eve NID: 248789, COID: 285, CNID: 256910, CNMID: 302402
2013-07-24 11:14:06 smsc SNMP Traps Service Problem No WARNING imad.sulaiman Nagios XI TrapName unknownOpcomCriticalTrap / trapNotificationId (INTEGER):3 trapSeverity (INTEGER):warning trapData (OCTETSTR):Message from user AUDIT9991ERVER on SMJL41 Security alarm (SECURITY) and security audit (SECURITY) on SMJL41, system id: 1306 Auditable NID
Re: check result max number of char
Go to the CCM --> Commands --> xi_service_notification_handler. Add:
To the end of the command. Then, proceed to add the lowercase macro to your notification template. Go to --> Admin --> Notification Management. In the service alert message field, change:
To:
Code: Select all
--longserviceoutput="$LONGSERVICEOUTPUT$"Code: Select all
Info:
%serviceoutput%Code: Select all
Info:
%longserviceoutput%Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
ahmad.zuhd
- Posts: 44
- Joined: Sun Jul 01, 2012 2:33 am
Re: check result max number of char
This is the already configured xi_service_notification_handler. To edit Notification Management, i have to get the enterprise Edition which i don't have.
can i set the change global to all users?
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
can i set the change global to all users?
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
Re: check result max number of char
Even without enterprise, each user should be able to configure their notification messages. Log in (or masquerade) as the user and then click the user name in the upper right hand corner of the interface and then click on "Notification Messages" in the left hand navigation pane. Here is where you can alter the message for the user. Enterprise allows for bulk editing of these messages among other perks.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
ahmad.zuhd
- Posts: 44
- Joined: Sun Jul 01, 2012 2:33 am
Re: check result max number of char
aha i can see that now and each user can edit his notification.
First Question, I have noted that there is a default content for each user, can i change that default content?
The Second issue for the max number of char is in the NagiosXI service history as in the post
http://support.nagios.com/forum/viewtop ... on_handler
the issue is that the amount of information that is viewable in the Service Status Detail in NagioXI web interface is limited to the output field of nagios_servicechecks tables.
the solution in that post is to change the size of that column to more than 255 char. Can we have other solution by changing what the NagiosXI web interface display; to display long_outpu rather than output.
First Question, I have noted that there is a default content for each user, can i change that default content?
The Second issue for the max number of char is in the NagiosXI service history as in the post
http://support.nagios.com/forum/viewtop ... on_handler
the issue is that the amount of information that is viewable in the Service Status Detail in NagioXI web interface is limited to the output field of nagios_servicechecks tables.
the solution in that post is to change the size of that column to more than 255 char. Can we have other solution by changing what the NagiosXI web interface display; to display long_outpu rather than output.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check result max number of char
The default can be set if you have the Enterprise version (or trial) enabled. Admin -> Manage Notificationsahmad.zuhd wrote:First Question, I have noted that there is a default content for each user, can i change that default content?
The Service Status Detail page in Nagios XI does include long_output, as well however you need to understand that long_output ONLY contains output AFTER the first line break of the plugin output, and if the plugin output is all on one line, it will be truncated at the 255 char cap without changing the DB.ahmad.zuhd wrote:the issue is that the amount of information that is viewable in the Service Status Detail in NagioXI web interface is limited to the output field of nagios_servicechecks tables.
the solution in that post is to change the size of that column to more than 255 char. Can we have other solution by changing what the NagiosXI web interface display; to display long_outpu rather than output.