GithubHelp home page GithubHelp logo

Comments (4)

itskannanraj avatar itskannanraj commented on June 5, 2024 1

Thank you

from python-alerta-client.

satterly avatar satterly commented on June 5, 2024

HTML links only work if they are sent in the alert text. Any reason why you want the link in the event name. That could effect alert de-duplication/correlation.

from python-alerta-client.

itskannanraj avatar itskannanraj commented on June 5, 2024

Thank you Sattery, I am going to use Aletta for multiple nagios, I would like to have nagios service check name should be redirected to actual nagios check page and I will send nagios service description to text filed.
So only I would like to have html link in event filed.
Pls help me is there any way to do it

from python-alerta-client.

satterly avatar satterly commented on June 5, 2024

I suggest you put it in an attribute ...

#!/usr/bin/env python
from alertaclient.api import Client
client = Client()
a = """
        <html>
        <a href="where/you/want/the/link/to/go">text of the link</a>
        </html>
    """
try:
    alert = client.send_alert(
        severity='critical',
        environment='Production',
        service=['s11p02b175'],
        resource='10.11.12.175',
        event='foo',
        value='Check_Disks',
        attributes={'nagiosUrl':a},
        # text='CRIT bounce=1008Brfailsafe=0, queue=0',
        text=a
    )
    print(alert)
except Exception as e:
    print(e)

If it is an attribute value it will render the HTML link correctly in the alert details page.

If you need it to be visible in the alert list without having to click in to see the alert details then you will need to modify the alert-list.html file. Within the ng-repeat="alert in alerts... add the following...

<td><span ng-bind-html="alert.attributes.nagiosUrl"></span></td>

You will also need to give it a suitable column heading in the block of code above otherwise everything will be out by one.

Let me know if you need any more help.

from python-alerta-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.