Page 1 of 1

Nagios XI web interface using Shell/HTML script

Posted: Sun Sep 30, 2018 12:36 pm
by sajid4u2c
Hi All,

I have a requirement, wherein I need to display overall status of a hots group and customise it to our own requirements .
Be it the widget size, font or background color of the host which in down/up/unknown state.
Nagios XI does has the inbuilt host group status/summary pages but I am looking far more customisation.
Basically I know Shell & HTML well. It would be helpful if I get a start to this.

I have gone through the below link for Nagios XI commands. But are there any more ? Which can be used to just display the statistics rather perform operations ?

https://assets.nagios.com/downloads/nag ... btnSubmit=

Also went through web interfaces which requires some tools to be installed

https://exchange.nagios.org/directory/A ... terfaces

Nagios version used is 5.5.2

Re: Nagios XI web interface using Shell/HTML script

Posted: Mon Oct 01, 2018 1:24 pm
by benjaminsmith
Hello,

You can use the custom includes component to upload you own css classes, images and JavaScript files and customize the XI interface. Additionally, this will not be overwritten by future updates of XI.

We have a knowledgebase article on the Custom Includes Component here:
https://support.nagios.com/kb/article.php?id=556

Also, more dashlets are available on the Nagios Exchange:
https://exchange.nagios.org/directory/Addons/Dashlets

Re: Nagios XI web interface using Shell/HTML script

Posted: Thu Oct 04, 2018 5:49 am
by sajid4u2c
Thanks @benjaminsmith .

But I was actually looking for some thing like below code. Below code will acknowledge the host problem.
Similar way, Can I get the command which could list all the members in a particular host group ?
Say, Windows_servers is a host group with some 10 servers.
So, If I could get the command to list these 10 servers , I will use it in shell script and display the result in table format using HTML and show the result in a HTML page.

Code: Select all

#!/bin/sh
# This is a sample shell script showing how you can submit the ACKNOWLEDGE_HOST_PROBLEM command
# to Nagios. Adjust variables to fit your environment as necessary.

now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'

/bin/printf "[%lu] ACKNOWLEDGE_HOST_PROBLEM;host1;2;1;1;Some One;Some Acknowledgement Comment\n" $now > $commandfile 

Re: Nagios XI web interface using Shell/HTML script

Posted: Thu Oct 04, 2018 7:28 am
by scottwilkerson
You cannot use the nagios.cmd to get information, only to submit commnads.

In Nagios XI you can get all of the information you are looking for through:
Help -> REST API Docs -> Objects Reference

Re: Nagios XI web interface using Shell/HTML script

Posted: Fri Oct 05, 2018 9:48 am
by sajid4u2c
Thanks @ scottwilkerson

====
You cannot use the nagios.cmd to get information, only to submit commnads.
cool. Need to check some other alternatives then.
We have a large monitor setup to display the alerts.
I was just looking for creating some customised dashboards/tables for different application teams by pulling data from Nagios.

Re: Nagios XI web interface using Shell/HTML script

Posted: Fri Oct 05, 2018 9:59 am
by scottwilkerson
sajid4u2c wrote:Thanks @ scottwilkerson

====
You cannot use the nagios.cmd to get information, only to submit commnads.
cool. Need to check some other alternatives then.
We have a large monitor setup to display the alerts.
I was just looking for creating some customised dashboards/tables for different application teams by pulling data from Nagios.
Sounds good.