mirror of https://github.com/mikaku/Monitorix.git
added the options 'username' and 'password' in 'mongodb.pm' to provide support for authentication. #246
This commit is contained in:
parent
220ad09e8d
commit
cdd30ed9d1
|
@ -209,9 +209,13 @@ sub mongodb_update {
|
|||
my $mongo = trim($ml[$n]);
|
||||
my $host = $mongodb->{desc}->{$mongo}->{host} || "";
|
||||
my $port = $mongodb->{desc}->{$mongo}->{port} || "";
|
||||
my $user = $mongodb->{desc}->{$mongo}->{username} || "";
|
||||
my $pass = $mongodb->{desc}->{$mongo}->{password} || "";
|
||||
my $cmd = "mongo ";
|
||||
$cmd .= "--host $host " if $host;
|
||||
$cmd .= "--port $port " if $port;
|
||||
$cmd .= "-u $user " if $user;
|
||||
$cmd .= "-p $pass " if $pass;
|
||||
$cmd .= "--eval \"printjson(db.serverStatus())\"";
|
||||
|
||||
if(open(IN, "$cmd |")) {
|
||||
|
|
|
@ -2377,6 +2377,16 @@ This is the port number of the MongoDB server specified in its block.
|
|||
Default value: \fI\fP
|
||||
.RE
|
||||
.P
|
||||
.BI username
|
||||
.RS
|
||||
This is the username for authentication of the MongoDB server specified in its block.
|
||||
.RE
|
||||
.P
|
||||
.BI password
|
||||
.RS
|
||||
This is the password for authentication of the MongoDB server specified in its block.
|
||||
.RE
|
||||
.P
|
||||
.BI db_list
|
||||
.RS
|
||||
This is a comma-separated list of databases to be monitored of the MongoDB server specified in its block.
|
||||
|
|
Loading…
Reference in New Issue