DX Unified Infrastructure Management

 View Only

  • 1.  Using robot variable in sqlserver connction/profile strings

    Posted Oct 23, 2024 04:16 AM
    Edited by David Givens Oct 23, 2024 04:34 AM

    Hi all,

    I am wondering if its possible to use variables in the sqlserver probe ?

    I have a large number of sql server servers to monitor and they all use the default instance, which matches the robot name.

    I have created an package to use $robot but this doesnt seem to parse. I am assuming it is not possible, but thought I would confirm/check.

    For example

       <$robot> overwrite
          user = user
          password = pass
          auto_domain = yes
          description = $robot
          conn_string = $robot
          retry = 4
          retry_delay = 2 min
          winauth = 1
          encryption = no
          enable_CrossDomain_conn = no
          timeout = 1 min
          monitor_AlwaysOn = no
          is_AlwaysOn = 
          tls_enable = no
       </$robot>

    Thanks



  • 2.  RE: Using robot variable in sqlserver connction/profile strings

    Posted Oct 23, 2024 01:11 PM
    Edited by Garin Walsh Oct 23, 2024 01:11 PM

    It's hit or miss whether environment variable expansion happens in a config or not.

    Would suggest something that looks like:

    <sqlserver> overwrite
          user = user
          password = pass
          auto_domain = yes
          description = $NIM_ROBOT_NAME
          conn_string = $NIM_ROBOT_NAME
          retry = 4
          retry_delay = 2 min
          winauth = 1
          encryption = no
          enable_CrossDomain_conn = no
          timeout = 1 min
          monitor_AlwaysOn = no
          is_AlwaysOn = 
          tls_enable = no
       </sqlserver>

    If that doesn't work, try ${NIM_ROBOT_NAME} instead.

    I would expect this not to work but it would be neat if it did.




  • 3.  RE: Using robot variable in sqlserver connction/profile strings

    Posted Oct 24, 2024 03:25 AM

    Thanks, Garin.

    The variables didnt parse, but the input is appreciated.




  • 4.  RE: Using robot variable in sqlserver connction/profile strings

    Broadcom Employee
    Posted Oct 24, 2024 03:26 AM
    Edited by Rajesh Banuka Oct 24, 2024 03:27 AM

    Hi David,

    Did you try with localhost or 127.0.0.1 as conn_string parameter. Hopefully it should connect to the local DB instance and metric or alarms gets correlated to the Robot.

    Rgds,

    Rajesh b




  • 5.  RE: Using robot variable in sqlserver connction/profile strings

    Posted Oct 24, 2024 03:31 AM

    Hi Rajesh,

    Thanks for the input

    I didnt, but the reason I didnt is because, if memory serves me correctly, the profile name or connection name is used in qos source/target generation so they would come back as 127.0.0.1 in QoS metrics.




  • 6.  RE: Using robot variable in sqlserver connction/profile strings

    Posted Oct 24, 2024 03:54 AM

    Hi David,

    Perhaps you can try the package "post install command" to replace the "$robot" by %computername% (if windows) by one of the available replace utilities, like sed, fnr, ..? 




  • 7.  RE: Using robot variable in sqlserver connction/profile strings

    Posted Oct 24, 2024 04:01 AM

    Hi Luc,

    Interesting idea. Maybe use nexec or logmon to trigger a powershell command.. i will test that. Thanks