Custom dashlet command line import?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
brandondash
Posts: 48
Joined: Fri Jan 27, 2017 9:02 am

Custom dashlet command line import?

Post by brandondash »

My google-fu is weak and I can't find documentation on this.

How do I upload/import custom dashlets into my Nagios via a command line tool? The documentation on the RESTApi documentation only discusses commands, hosts, and services. The documentation on dashlets only discusses the web interface.

We want user interaction completely out of the equation (Puppet/Ansible/Chef type solution) but I'm stuck on the final step here. Help!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Custom dashlet command line import?

Post by mcapra »

A related thread:
https://support.nagios.com/forum/viewto ... 16&t=53120

Here's how Nagios XI is handling dashlet installation as of 5.5.9 (a bit old), from subcomponents/xidashlets/install:

Code: Select all

#!/bin/bash -e

. ../../xi-sys.cfg

echo "INSTALL: Installing/updating XI dashlets..."

echo "Backing up existing dashlets to /tmp/xidashlets_backup..."

/bin/cp -f ../../nagiosxi/basedir/tools/install_dashlet.php "$proddir/tools/"

/bin/mkdir -p /tmp/xidashlets_backup
cp -rf "$proddir"/html/includes/dashlets/* /tmp/xidashlets_backup

# Install/update each dashlet
for f in `ls -1 dashlets/*.zip`; do
	echo "Installing '$f'"
	
	"$proddir/tools/install_dashlet.php" --file=$f --refresh=0

done

# Things are okay
echo "INSTALL: Dashlets installed/updated OK."

Which reveals a install_dashlet.php script located at nagiosxi/basedir/tools. That's probably a good place to dig around.

Another +1 for official Puppet/Salt/Ansible/Chef/whatever integration :)
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Custom dashlet command line import?

Post by scottwilkerson »

brandondash wrote:My google-fu is weak and I can't find documentation on this.

How do I upload/import custom dashlets into my Nagios via a command line tool? The documentation on the RESTApi documentation only discusses commands, hosts, and services. The documentation on dashlets only discusses the web interface.

We want user interaction completely out of the equation (Puppet/Ansible/Chef type solution) but I'm stuck on the final step here. Help!
Are you referring adding dashlets to dashboards, or are you referring to installing custom dashlets into the system?

If the later, then mcapra's suggestion would be a possibility, but if the former, there is no way to do this through the API, but you can deploy dashboards to users from an Admin account.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked