cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
981
Views
0
Helpful
6
Replies

Error connecting to Ise Db using dataconnect

Hey, i am facing an error while trying to connect to ise db after enabling the data connect feature . 

The code is:dataconnect ,ise

package maindataconnect ,ise

import (
    "database/sql"
    "fmt"
    "log"

    _ "github.com/sijms/go-ora/v2" // Oracle DB driver
)

func main() {
    // Define the connection string for Oracle with SSL/TCP
    dsn := `dataconnect/password@tcps(1.1.1.1:2484)/cpm10?ssl=true&ssl_cert=<path_to_cert>`

    // Open a database connection using the go-ora driver
    db, err := sql.Open("oracle", dsn)
    if err != nil {
        log.Fatalf("Failed to open connection: %v", err)
    }
    defer db.Close()

    // Try to ping the database to check connectivity
    err = db.Ping()
    if err != nil {
        log.Fatalf("Failed to ping database: %v", err)
    } else {
        fmt.Println("Successfully connected to the Cisco ISE Database!")
    }

    // Sample query: List Network Device Groups
    rows, err := db.Query("SELECT * FROM NETWORK_DEVICE_GROUPS")
    if err != nil {
        log.Fatalf("Error executing query: %v", err)
    }
    defer rows.Close()

    // Print query results
    fmt.Println("\nList of Network Device Groups:")
    for rows.Next() {
        var id, name, status string
        err := rows.Scan(&id, &name, &status)
        if err != nil {
            log.Fatalf("Error scanning row: %v", err)
        }
        fmt.Printf("ID: %s, Name: %s, Status: %s\n", id, name, status)
    }

    if err := rows.Err(); err != nil {
        log.Fatalf("Row iteration error: %v", err)
    }
}
 
the error i am facing is :  
2024/12/24 15:11:16 Failed to ping database: missing port in address

Can someone tell me what mistake am I doing or if anyone could give steps on how to build a connection with the ISE Db after enabling the dataconnect feature.

6 Replies 6

thomas
Cisco Employee
Cisco Employee

You will want to include any and all troubleshooting steps you have done to verify it is enabled so we do not waste time telling you to try things you have already done. I have no idea what tools you have tested with. Remember that Data Connect runs on the MNT node.

Your DSN hostname is invalid if this is truly your production code since CloudFlare (1.1.1.1) is not an ISE node!

dsn := `dataconnect/password@tcps(1.1.1.1:2484)/cpm10?ssl=true&ssl_cert=<path_to_cert>`

When I dump my OracleDB Connection String from my iseql.py script using the oracledb package:

❱ iseql.py "SELECT command,command_args FROM TACACS_COMMAND_ACCOUNTING" --level DEBUG
2025-01-09 05:11:20.746 | DEBUG | iseql | <module> | OracleDB Connection String: (DESCRIPTION=(RETRY_COUNT=3)(RETRY_DELAY=3)(ADDRESS=(PROTOCOL=tcps)(HOST=ise-ppan.demo.local)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=cpm10))

You will also want to verify you can ping your ISE Primary MNT node and there is no firewall blocking port 2484 between you and the ISE Primary MNT node.

We have done a couple ISE Webinars to show you how to use Data Connect:

▷ Next Generation ISE Telemetry, Monitoring, and Custom Reporting Part 2 |
06:00 Reports vs Data Connect
08:10 Data Connect (ISE 3.2 and later)
How to Get Data Out of ISE | 2024-04-02
48:32 ISE Data Connect

I recommend posting Cisco Identity Services Engine (ISE), RADIUS, and TACACS+ related questions in the ISE/NAC Network Access Control (https://cs.co/ise-community) community forum for the best visibility and RADIUS expertise.

Hey Thomas , 

1.1.1.1is not my ip it is just mentioned there since i don't wish to put the ip on the protal.

Cisco dataconnect is enabled on my ise gui , i hhvae checked multiple tims , in order to verify further i checked the Ise CLI and we have the listener service up and runnning . I have seen these videos that u have mentioned here , but idk why i am unable to connect to dataconnect

 

I don't know how many ISE nodes you have but Data Connect only runs on the ISE Primary MNT node.

Did you actually enable Data Connect?

Enable_DataConnect.png

Verify you are connecting to the PMNT node - not another ISE node.

Also consider testing with my iseql.py or isedc.py Python scripts since I don't know recognize your language above.

Usage details at https://github.com/1homas/ISE_Python_Scripts#iseqlpy

Finally, our next ISE Webinar on March 4 is ISE Data Connect Deep Dive if you want to attend or watch it on our CiscoISE Youtube Channel ~1 week after the live webinar.

20250304 ISE Webinars - ISE Data Connect Deep Dive - promo.png

Hey Thomas,

This is a staging setup , so at the moment we only have one Ise node, and yes i have enabled the dataconnect feature sir .

I have tried connecting to the db , using dbVisualizer, Golang script,Oracle sqlDeveloper, but i am unable to do so .

graceava466
Level 1
Level 1

Looks like your DSN format is incorrect. Try this:

go
Copy
Edit
dsn := "oracle://dataconnect:password@1.1.1.1:2484/cpm10?ssl=true&ssl_cert=<path_to_cert>"
The "missing port in address" error usually happens when the connection string isn't formatted properly. Also, double-check that port 2484 is open and your SSL cert path is correct.

If it still fails, try a basic TCP connection first:

go
Copy
Edit
dsn := "oracle://dataconnect:password@1.1.1.1:1521/cpm10"
Funny enough, debugging these errors can feel like searching for the perfect Subway Soßen Welt—small details make all the difference!

hey,

with this dsn := "oracle://dataconnect:password@1.1.1.1:2484/cpm10?ssl=true&ssl_cert=<path_to_cert>",

the error is : 
2025/02/07 10:52:18 Error pinging the database: SQLDriverConnect: {IM002} [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

and with ,

this :dsn := "oracle://dataconnect:password@1.1.1.1:1521/cpm10", the error is :

Error pinging the database: SQLDriverConnect: {IM002} [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
{01S00} [Microsoft][ODBC Driver Manager] Invalid connection string attribute.

And i am able to telnet the ip on this port , which mens the port is open and i have ensured that my cert pathis correct mam,

 

You are absolutely correct , these small details make all the difference ...... and perfect example for that btw ..hahaha.

Thanks.