Create source via API

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.
Locked
danielheaton
Posts: 12
Joined: Wed Jun 06, 2018 2:51 am

Create source via API

Post by danielheaton »

Hi all

Very new to Nagios NA so apologies if this is a dumb question, have looked around forums but drawn a blank so far, and this is a bit old and quite limited https://support.nagios.com/kb/article/n ... s-800.html.

We use Ansible to provision our hosts, and to register them in NagiosXI and create services, etc. via the API. Is it possible to do a similar thing with sources in Network Analyzer?

Eg. in my hosts file I would have

10.1.2.3 hostname=myServer nagios_na_server=nagiosNaForThisNetwork nagios_na_port=1234

This would then give me the info I need to install my netflow forwarder, point that to the chosen port and Network Analyzer node, and create a source with the name of the server and the defined port on the appropriate Network Analyzer node.

Is that doable?

If not, be good to hear of any timesaving ways to set up lots of hosts quickly!

Cheers

Daniel
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Create source via API

Post by cdienger »

The ability to add sources via the API isn't available at the moment, but you could add a new source by adding it directly to the database.

For example:

Code: Select all

echo "insert into nagiosna_Sources(port, addresses, name, flowtype, directory, lifetime, disable_abnormal) values(9999,'5.6.7.8','test','netflow','/usr/local/nagiosna/var/test','48H',0);" | mysql -unagiosna -pnagiosna -Dnagiosna
echo "select * from nagiosna_Sources;" | mysql -unagiosna -pnagiosna -Dnagiosna 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
danielheaton
Posts: 12
Joined: Wed Jun 06, 2018 2:51 am

Re: Create source via API

Post by danielheaton »

Thanks, that should be scriptable, cheers!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Create source via API

Post by benjaminsmith »

Hi,

Grea! Did you have other questions or shall we close out this topic?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Create source via API

Post by cdienger »

Cheers!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked