Ad Widget

Collapse

Need help to use oracle plugin and use Oracle Template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • studero
    Member
    • Aug 2023
    • 84

    #1

    Need help to use oracle plugin and use Oracle Template

    Hi all guys,

    I have an Oracle server run with two PDB on the same Containers with using the same user to monitor. I'a able to use this use to access to the CDB and the two PDB. I have configured the following parameters in the oracle.conf file in /etc/zabbix/zabbix-agent.d/plugins. Setting are :

    Plugins.Oracle.Sessions.co11911e.Uri=tcp://svx-ora-11e:1521
    Plugins.Oracle.Sessions.DAP1.Uri=tcp://svx-ora-11e:1521
    Plugins.Oracle.Sessions.IAP1.Uri=tcp://svx-ora-11e:1521

    Plugins.Oracle.Sessions.co11911e.Service=co11911e. unifr.ch
    Plugins.Oracle.Sessions.DAP1.Service=DAP1.unifr.ch
    Plugins.Oracle.Sessions.IAP1.Service=IAP1.unifr.ch

    Plugins.Oracle.Sessions.co11911e.User=zabbix
    Plugins.Oracle.Sessions.DAP1.User=zabbix
    Plugins.Oracle.Sessions.IAP1.User=zabbix

    Plugins.Oracle.Sessions.co11911e.Password=password
    Plugins.Oracle.Sessions.DAP1.Password=password
    Plugins.Oracle.Sessions.IAP1.Password=password​

    In the Host on the web console, I have configured this following Macros:
    {$ORACLE.CONNSTRING} = tcp://svx-ora-11e:1521
    {$ORACLE.PASSWORD} = password
    {$ORACLE.SERVICE} = co11911e.unifr.ch
    {$ORACLE.USER} = zabbix

    I need help to understand if it's correctly set and if I need other setting. The reason is that I have many errors with Dependens Items for the PDB IAP1. See below an exemple of error:
    [root@svx-mon-02p ~]# zabbix_get -s svx-ora-11e -k oracle.ts.stats["tcp://svx-ora-11e:1521","zabbix","password","co11911e.unifr.ch ","ACTIVITI","PERMANENT","DAP1"]
    [{"ACTIVITI":{"contents":"PERMANENT","file_bytes ":1 2616466432,"max_bytes":32212254720,"free_bytes":74 5603072,"used_bytes":11870863360,"used_pct_max":39 .17,"used_file_pct":94.09,"used_from_max_pct":36.8 5,"status":1}}]
    [root@svx-mon-02p ~]# zabbix_get -s svx-ora-11e -k oracle.ts.stats["tcp://svx-ora-11e:1521","zabbix","password","co11911e.unifr.ch ","ACTIVITI","PERMANENT","IAP1"]

    [root@svx-mon-02p ~]#​

    And on the Zabbix console server, I see the error message:
    Preprocessing failed for:
    1. Failed: cannot extract value from json by path "$..['ACTIVITI'].status.first()": invalid object format, expected opening character '{' or '[' at: ''​

    Click image for larger version

Name:	image.png
Views:	386
Size:	129.4 KB
ID:	491892

    I use Zabbix version 7.0.4 for the server and version 7.0.3 for the client.

    I need help
    Regards
    Olivier
    Last edited by studero; 27-09-2024, 16:06.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    If you have defined all named sessions in agent config, why do you still keep specifying sessions and usernames etc.?
    Shouldn't it be enough, if you give just session name as parameter and agent finds all the rest from config file? If you define those macros, then they are going to be used to override agent config..
    1. Set the {$ORACLE.CONNSTRING} macro value using either <protocol(host: port)> or named session.
    2. If you want to override parameters from Zabbix agent configuration file, set the user name, password and service name in host macros ({$ORACLE.USER}, {$ORACLE.PASSWORD}, and {$ORACLE.SERVICE}).

    Comment

    • studero
      Member
      • Aug 2023
      • 84

      #3
      Hy Cyber,

      Originally posted by cyber
      If you have defined all named sessions in agent config, why do you still keep specifying sessions and usernames etc.?
      Shouldn't it be enough, if you give just session name as parameter and agent finds all the rest from config file? If you define those macros, then they are going to be used to override agent config..
      1. Set the {$ORACLE.CONNSTRING} macro value using either <protocol(host: port)> or named session.
      2. If you want to override parameters from Zabbix agent configuration file, set the user name, password and service name in host macros ({$ORACLE.USER}, {$ORACLE.PASSWORD}, and {$ORACLE.SERVICE}).
      So, if I understand correctly, in my case I need to create three hosts one for each {$ORACLE.CONNSTRING} for only parameters. The all other parameters and values, the agent take what is write into the plugin agent config file ?

      This is true ?

      I have configured only this parameter {$ORACLE.CONNSTRING} but that's does not work. The Oracle template does not able to get the values of the following parameters {$ORACLE.USER}","{$ORACLE.PASSWORD}","{$ORACLE.SER VICE}".

      Why ? I need more help
      Last edited by studero; 30-09-2024, 15:06.

      Comment

      • studero
        Member
        • Aug 2023
        • 84

        #4
        Originally posted by cyber
        If you have defined all named sessions in agent config, why do you still keep specifying sessions and usernames etc.?
        Shouldn't it be enough, if you give just session name as parameter and agent finds all the rest from config file? If you define those macros, then they are going to be used to override agent config..
        1. Set the {$ORACLE.CONNSTRING} macro value using either <protocol(host: port)> or named session.
        2. If you want to override parameters from Zabbix agent configuration file, set the user name, password and service name in host macros ({$ORACLE.USER}, {$ORACLE.PASSWORD}, and {$ORACLE.SERVICE}).
        Hy Cyber,

        I have configured the oracle.conf file as follow in the plugin directory on the Oracle Server:
        Plugins.Oracle.Sessions.TPAP1.Uri=tcp://svx-ora-01cl:1521

        Plugins.Oracle.Sessions.TPAP1.Service=tpap1.unif.c h

        Plugins.Oracle.Sessions.TPAP1.User=zabbix

        Plugins.Oracle.Sessions.TPAP1.Password=password


        On the Zabbix server, I can made a oralce.ping with good result :
        # zabbix_get -s svx-ora-01cl -k oracle.ping[TPAP1]
        1
        #

        Then I have create a new host on the Web console page of Zabbix with setting only the parameter :
        {$ORACLE.CONNSTRING} = TPAP1

        Then I see the following error on the oracle.ping item :
        Connection to database is unavailable

        If I test the oracle.ping I see the following value of the paremeter.
        Click image for larger version

Name:	image.png
Views:	307
Size:	35.7 KB
ID:	492748

        Why I do not see the correct value of {$ORALCE.PASSWORD} and $ORACLE.SERVICE} ?

        I need help

        Thanks for your help
        Regards
        Olivier


        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #5
          Item is never going to look it up from your plugin config on a remote server... What you see is in your template or host macros... I think you should remove everything besides {$ORACLE.CONNSTRING}
          (I have not used that plugin myself... )

          Comment

          Working...