NCPA Adding Custom Data to the Web Page

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

NCPA Adding Custom Data to the Web Page

Post by mikew »

What do I need to know in order to add custom data on the web page for NCPA on a host. I am working with a company that wants to add serveral custom graphics for data on the web page.

I can see in the source that there are several functions that create the current data. Can I just write a custom function and add it to this page:

Code: Select all

function load_interface() {
    var interface_div = $('#interface');
    var INTERFACE_API = '/api/interface/';
    var INTERFACE_BASE = '/graph/interface/';
    var metrics = ['bytes_recv', 'bytes_sent'];
    
    $.getJSON(INTERFACE_API, function(d) {
        $.each(d.value['interface'], function(key) {
            var sent = INTERFACE_BASE + key + '/bytes_sent?delta=1&unit=K';
            var recv = INTERFACE_BASE + key + '/bytes_recv?delta=1&unit=K';
            interface_div.append($('<div>').load(sent));
            interface_div.append($('<div>').load(recv));
        })
    })
}
Any information on what I need to do would be helpful....
Mike Weber

Nagios Training/Consulting
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NCPA Adding Custom Data to the Web Page

Post by abrist »

You will most likely have much better luck getting this answer on the ncpa github page: https://github.com/NagiosEnterprises/ncpa
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.
Locked