Page 1 of 1

Url in Notes

Posted: Wed Jun 25, 2014 7:34 am
by WillemDH
Hello,

I would like to make use of the Notes tab in the service status detail and use it to link to internal documentation. When I put an url in this notes, it is not clickable. I tried using <a href="url"> Link</a> , but this doesn't seem to work as expected, the html tags are just removed.

Is there any way to make use of url's in this notes tab?

I noticed there does not seem to be a link between this notes tab and the notes in the CCM -> Misc Settings. Is there any way to edit notes paart from using the notes tab?

Grtz

Willem

Re: Url in Notes

Posted: Wed Jun 25, 2014 9:10 am
by tmcdonald
I assume you are referring to the Notes component? If so I am seeing the same behavior and I believe this is intentional as the text area is just a HTML <textarea> element which would not be able to show a link. I can put in a feature request to change this behavior if you'd like.

Re: Url in Notes

Posted: Wed Jun 25, 2014 2:39 pm
by WillemDH
That would be nice. We would like to link to existing documentation. Just another notes related question. There is no relationship between the notes component and the notes field in CCM misc settings right? So where is this notes component text saved? (backend)

Re: Url in Notes

Posted: Wed Jun 25, 2014 2:53 pm
by tmcdonald
There is no relation, no. The CCM notes field is stored in the MySQL nagiosql database, and the object notes component data is stored in the PostgreSQL nagiosxi database.

Re: Url in Notes

Posted: Wed Jun 25, 2014 2:59 pm
by WillemDH
Another question (once I start it's hard to stop..) => Is it possible to include the notes in the email template in case of an alert. So when for example a service that monitors the Exchange aggregate queue length exceeds a certain threshold, an email is sent to an on duty contact with the notes in the alert that would (after the feature request you already made (or maybe not ;) is finished) link to a procedure how to clean up the queue.
I can make the feature request myself if you want. That way it's easier for me to follow it up.. :)

Grtz

Willem

Re: Url in Notes

Posted: Wed Jun 25, 2014 3:13 pm
by tmcdonald
For standard "notify-host-by-email" and "notify-service-by-email" commands you can simply add any of these: http://nagios.sourceforge.net/docs/3_0/macrolist.html

As long as they are supported in notifications, they can be put in.

As far as the Admin -> Notification Management section goes, you will need to specify in the xi_host_notification_handler and xi_service_notification_handler commands what you would like to add macro-wise, like so:

Code: Select all

define command {
       command_name                     xi_service_notification_handler
       command_line                     /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$"
}
then add something like: --notes="$SERVICENOTES"

Now you can use %notes% in the notification template for service notes. Does that make sense?

http://assets.nagios.com/downloads/nagi ... iables.pdf

Re: Url in Notes

Posted: Thu Jun 26, 2014 2:47 am
by WillemDH
Trevor,

It does make sense. I made the feature request in the meantime. http://tracker.nagios.com/view.php?id=552

Grtz

Willem

Re: Url in Notes

Posted: Thu Jun 26, 2014 9:13 am
by tmcdonald
Shall we close this one up? I looked at the source for the Notes component and I could probably make the changes, but usually if we have to spend more than half an hour it's a sign that the actual developers should do it.

Re: Url in Notes

Posted: Thu Jun 26, 2014 9:15 am
by WillemDH
Trevor,

Ok, I'll wait patiently for the developers to do it. Let them know if they want me to test something, I'd be happy to help. You can close this thread.

Grtz

Willem