I have a distributed Mongodb setup and I'm trying to configure it with Icinga2 using the following link as reference,
https://admin-docs.com/databases/mongodb/mongodb-administration/monitor-mongodb-using-icinga/
As mine is a distributed setup, Icinga should connect to Mongodb along with hostname parameter as,
mongo -h ipaddress
Without this, Icinga2 dashboard shows the following error for all the MongoDB monitoring services,
CRITICAL - Connection to Mongo server on 127.0.0.1:27017 has failed
How do I configure my Icinga2 setup to use hostname in the command?