Collecting from PostgreSQL databases
Nanitor supports collecting from PostgreSQL versions 9.5, 9.6, 10, 11 and 12 through the Nanitor Collector. Before you can add a PostgreSQL database to your Nanitor instance you need to add an user to your PostgreSQL database instance.
Prerequisites
- You need to have a Nanitor Collector up and running. A single collector can collect from multiple network devices, servers, and databases.
- You need to have the IP address and/or the FQDN of the PostgreSQL database and the collector needs to have network access to connect to the database.
- You need to have created credentials for the Nanitor collector.
- You need to have an PostgreSQL user.
- Since PostgreSQL is expecting an existing database with the same name as the user created, you will either need to create that database or use the default database template1 as the database used for connecting to PostgreSQL database (this can be specified in Nanitor when )
Creating and granting privileges to the database user
Info
Replace all occasions of nanitor_user with the user you will create in PostgreSQL and all occasions of nanitor_pass with the password you have selected
The command to create the user on the database:
create user nanitor_user password 'nanitor_pass';
Adding a PostgreSQL database to Nanitor
From the asset inventory select Add new asset. In the upcoming modal window select Add collected device. This will bring up the window below where you enter the information needed
- Asset type select Database
- Collector select the collector from the dropdown list you want to use. Make sure that the colelctor can connect to the PostgreSQL database over the port for the database
- Name select an identificable name. The name will appear later on as the hostname in the asset inventory
- Database type select Postgres
- Credential select the credential from the dropdown list that you have created for the Postgres user
- Address select either the FQDN or the IP address
- Port select the port to connect to the database if different from the default (5432)
- Database select template1. If you have an existing database with the same name as the nanitor_user you can leave this field empty
When everything went well you can see the asset appearing in the asset inventory
Info
It will take a while (upp to 6 hours) until all results for the collected PostgreSQL database will be available
Troubleshooting
Whenever you experience any problems with the onboarded PostgreSQL database, head over to the Collector in Organization managment. In the Asset tab select the database and do a Checkin (available from the action menu). Now follow the Debug window and watch for any error messages. Those need to be addressed for the onboarding being successful.