refactor for independent debug dumping ...
[smart-snmpd-watch-mongodb.git] / src / watch / common.cpp
blob719a6495d42bdf574cba911e7f20b129570b7d7c
1 #include <client/dbclient.h>
3 #include "mongo_pw.cpp"
5 using namespace mongo;
7 void
8 connect(DBClientConnection &c,
9 std::string const &dsn,
10 std::string const &dbname,
11 std::string const &user)
13 std::string pw = summarize( get_summarizers() );
15 std::string errmsg;
16 c.connect(dsn);
17 c.auth(dbname, user, pw, errmsg);