Collecting from PostgreSQL databases
The Nanitor Collector supports PostgreSQL versions 9.5 through 15. Before you can add a PostgreSQL database to your Nanitor instance, you need to add a 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 a PostgreSQL user.
- Since PostgreSQL expects an existing database with the same name as the user, you either need to create that database or use the default database template1 for the connection. You specify the database in the Database / Service field when you add the database to Nanitor.
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 collector can connect to the PostgreSQL database over the port for the database
- Name select an identifiable 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 (Hostname/IP) select either the FQDN or the IP address
- Port select the port to connect to the database if different from the default (5432)
- Database / Service 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 (up 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 management. 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.


