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!
Custom dashlet command line import?
Re: Custom dashlet command line import?
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:
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
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."
Another +1 for official Puppet/Salt/Ansible/Chef/whatever integration
Former Nagios employee
https://www.mcapra.com/
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?
Are you referring adding dashlets to dashboards, or are you referring to installing custom dashlets into the system?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!
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.