Closed pipinstallyogi closed 4 years ago
Did you do it in the following order?
Create Hana User with read rights on necessary schemas.
Create hana_sql_exporter.toml with one or more tenants and metrics (for example):
[[Tenants]]
Name = "t01"
Tags = []
ConnStr = "host1.example.com:32041"
User = "hanaread1"
[[Metrics]]
Name = "hdb_active_connections"
Help = "Active Hana connections per service"
MetricType = "gauge"
TagFilter = []
SchemaFilter = ["sys"]
SQL = "select COUNT(IFNULL(C.CONNECTION_STATUS, 'IDLE')) as connections, S.service_name as service FROM <SCHEMA>.M_CONNECTIONS C inner join <SCHEMA>.M_SERVICES S on C.PORT = S.PORT WHERE C.LOGICAL_CONNECTION_ID
= C.CONNECTION_ID AND C.OWN = 'FALSE' group by S.service_name"
Set password(s):
./hana_sql_exporter pw -config ./hana_sql_exporter.toml -tenant t01
If the connection can't be established, you get
level=error msg="Can't connect to tenant with given parameters." tenant=t01
Start hana exporter (in this case on default port 9658):
./hana_sql_exporter web -config ./hana_sql_exporter.toml
After that you should see one or more entries of type hdb_active_connections
with localhost:9658/metrics
Thanks for the quick reply: I have set up the password correctly as mentioned by you. Incidentally the .toml file get automatically a Secret field after password has been provided
Secret = [10, 45, 10, 9, 115, 101, 99, 114, 101, 116, 107, 101, 121, 18, 32, 18, 76, 41, 162, 139, 129, 184, 104, 72, 54, 131, 222, 91, 24, 234, 233, 203, 146, 100, 186, 110, 20, 175, 35, 250, 24, 247, 51, 35, 251, 237, 24, 10, 59, 10, 3, 104, 99, 101, 18, 52, 86, 58, 143, 178, 195, 28, 206, 77, 147, 107, 110, 77, 219, 205, 198, 148, 247, 65, 118, 82, 4, 170, 72, 118, 171, 35, 147, 186, 201, 225, 126, 252, 105, 9, 212, 150, 25, 194, 64, 24, 158, 97, 111, 134, 63, 85, 155, 132, 25, 11, 199, 125]
[[Tenants]] Name = "HBA" Tags = [] ConnStr = "18.190.3.95:30215" User = "dbuser"
[[Metrics]]
Name = "hdb_active_connections"
Help = "Active Hana connections per service"
MetricType = "gauge"
TagFilter = []
SchemaFilter = ["sys"]
SQL = "select COUNT(IFNULL(C.CONNECTION_STATUS, 'IDLE')) as connections, S.service_name as service FROM
After this when I enter the next command to start the exporter, ./hana_sql_exporter web -config ./hana_sql_exporter.toml
I receive the error: time="29-05-2020 11:15:13" level=error msg="Can't find or decrypt password for tenant - tenant removed!" error="encrypted tenant pw info does not exist" tenant=HBA
As a matter of fact, I am successful in running the 'sapnwrfc_exporter' provided by you in another repo . Almost all the steps are same and it runs successfully.
Note: The port is Connstr is where the host open the connection.
Your help is highly appreciated.
Can you please check, if it's an upper, lower case problem. The tenant name entry HBA in your example configfile has been written in uppercase. Did the tenant name in the password command has been written in lower case:
./hana_sql_exporter pw -config ./hana_sql_exporter.toml -tenant hba?
Thanks a lot for the reply. I guess it was the problem related with the uppercase. I have written the tenant database name in lowercase and also when assigning providing the command for the password in lowercase. It seem to be running now. Thanks again.
I have configured all the environment, password has been successfully added to toml file as Secret, however when I am running the command:
./hana_sql_exporter web -config ../hana_sql_exporter.toml -timeout 3
The following error has been presented:
time="28-05-2020 18:17:25" level=error msg="Can't find or decrypt password for tenant - tenant removed!" error="encrypted tenant pw info does not exist" tenant=HBA
I have tried all the configuration in two systems. Kindly help.