For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

TNY_122436's avatar
TNY_122436
Icon for Nimbostratus rankNimbostratus
May 15, 2014

EAV monitor file for DB2

Does anyone know how I can create an EAV file to monitor DB2 databases base on this argument:

 

Select count(*) from SYSIBMADM.SNAPHADR where HADR_ROLE = 'PRIMARY'

 

If it returns 1, it's the primary. If it returns 0, it's not the primary.

 

Thanks in advance for any help or input.

 

2 Replies

  • Hi!

    Lacking experience with DB2, but don't you need some kind of authentication before sending queries to the DB? Otherwise you could try a normal TCP monitor with a send and receive string?

    Send string:
    
    Select count(*) from SYSIBMADM.SNAPHADR where HADR_ROLE = 'PRIMARY'\r\n
    
    Receive string:
    
    1
    

    If this doesn't work I bet Kevin will come soon and save the day. 🙂

    /Patrik

  • I may be missing something here, but there's no DB2-specific EAV monitor. There's MSSQL, MySQL, and PostgreSQL. Further, I don't believe the SQL communication is raw text, so not sure a TCP monitor would work. It might be possible to use one of the defined SQL monitors here, in which case user, pass, and database are configuration fields. It may also be possible to use mysql from a script to query the database, but not really certain on any of these. I suppose if I had no other options, I might consider standing up a small LAMP environment and creating a PHP SQL connector from a web page, then simply monitoring that page to check the database.