Ad Widget

Collapse

How can monitor EMC devices by zabbix6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    How can monitor EMC devices by zabbix6

    I am using this doc for monitor EMC unity

    Python script for monitoring EMC Unity strages. Contribute to aklyuk/zabbix-emc-unity development by creating an account on GitHub.


    Unfortunately when I run it as follow it returns 1 and not return 0

    `
    [root@z6 externalscripts]# ./unity_get_state.py --api_ip=172.2.2.2 --api_port=443 --api_user="monitor" --api_password="pass@123" --storage_name=bakunity --discovery
    1

    `
    Also it shows in the unity_state.log

    2022-05-21 19:29:51,502 - unity_logger - INFO - Connection established
    2022-05-21 19:29:54,683 - unity_logger - INFO - Logout successful
    2022-05-21 19:32:51,118 - unity_logger - INFO - Connection established
    2022-05-21 19:32:54,320 - unity_logger - INFO - Logout successful
    2022-05-21 19:35:34,116 - unity_logger - INFO - Connection established
    2022-05-21 19:35:37,298 - unity_logger - INFO - Logout successful
    2022-05-21 19:35:51,112 - unity_logger - INFO - Connection established
    2022-05-21 19:35:54,306 - unity_logger - INFO - Logout successful
    2022-05-21 19:38:51,165 - unity_logger - INFO - Connection established
    2022-05-21 19:38:54,381 - unity_logger - INFO - Logout successful

    Why it cannot return 0 ? What is the problem

    I have defined storage_name=bakunity in zabbix . Also my zabbix-server version is 6
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    1 means that send_data_to_zabbix() (https://github.com/aklyuk/zabbix-emc...t_state.py#L87) returned 1. Check that you have zabbix-sender package installed correctly.

    Markku

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 176

      #3
      Originally posted by Markku
      1 means that send_data_to_zabbix() (https://github.com/aklyuk/zabbix-emc...t_state.py#L87) returned 1. Check that you have zabbix-sender package installed correctly.

      Markku

      zabbiz_server ip = 172.2.20.20

      Yes . I have installed zabbix_sender on zabbix-server
      Also I set ServerActive=172.2.20.20 in /etc/zabbix/zabbix_agent2.conf
      and As I am using zabbix_agent2 so edit script in line 89 to config_path = "/etc/zabbix/zabbix_agent2.conf"

      Unfortunatelt It returns 1 another

      Comment

      • Markku
        Senior Member
        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
        • Sep 2018
        • 1781

        #4
        https://www.zabbix.com/documentation.../zabbix_sender says that "If data sending failed, the exit status is 1."

        Check the Zabbix server logs, and if needed, comment out the os.remove() call in line 98, check the resulted file and run zabbix_sender manually with that data to find out what is wrong with your configuration. For example, do you have the matching host configured in Zabbix.

        Markku

        Comment

        • bab
          Senior Member
          • Aug 2020
          • 176

          #5
          Originally posted by Markku
          https://www.zabbix.com/documentation.../zabbix_sender says that "If data sending failed, the exit status is 1."

          Check the Zabbix server logs, and if needed, comment out the os.remove() call in line 98, check the resulted file and run zabbix_sender manually with that data to find out what is wrong with your configuration. For example, do you have the matching host configured in Zabbix.

          Markku

          When I run that script it does not write anything in zabbix_server.log
          I comment line 98 so it create a log with the name bakunity_1653235554.tmp in /tmp that contains all information that we need for unity device such as battery , ssd disk , .......
          I am really confuse what is the issue

          Comment

          • Markku
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Sep 2018
            • 1781

            #6
            What is the error you get from zabbix_sender when you try to send the same bakunity* data file with the same arguments as the script uses?

            Markku

            Comment

            • bab
              Senior Member
              • Aug 2020
              • 176

              #7
              Originally posted by Markku
              What is the error you get from zabbix_sender when you try to send the same bakunity* data file with the same arguments as the script uses?

              Markku

              Would you say what syntax I should use for that ?

              Comment

              • Markku
                Senior Member
                Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                • Sep 2018
                • 1781

                #8
                Line 97 says

                [sender_command, "-vv", "-c", config_path, "-s", storage_name, "-T", "-i", temp_file]

                so

                /usr/bin/zabbix_sender -vv -c /etc/zabbix/zabbix_agent2.conf -s bakunity -T -i /tmp/bakunity_1653235554.tmp

                (https://www.zabbix.com/documentation.../zabbix_sender)

                Markku

                Comment

                • bab
                  Senior Member
                  • Aug 2020
                  • 176

                  #9
                  Originally posted by Markku
                  Line 97 says

                  [sender_command, "-vv", "-c", config_path, "-s", storage_name, "-T", "-i", temp_file]

                  so

                  /usr/bin/zabbix_sender -vv -c /etc/zabbix/zabbix_agent2.conf -s bakunity -T -i /tmp/bakunity_1653235554.tmp

                  (https://www.zabbix.com/documentation.../zabbix_sender)

                  Markku

                  That is strange , it shows :

                  zabbix_sender [207041]: ./zabbix_agent2.d/plugins.d: [2] No such file or directory

                  Also I have follow path :

                  [root@z6 externalscripts]# ll /etc/zabbix/zabbix_agent2.d/plugins.d/
                  total 44
                  -rw-r--r--. 1 root root 1591 May 3 12:00 ceph.conf
                  -rw-r--r--. 1 root root 1959 May 3 12:00 docker.conf
                  -rw-r--r--. 1 root root 1113 May 3 12:00 memcached.conf
                  -rw-r--r--. 1 root root 592 May 3 12:00 modbus.conf
                  -rw-r--r--. 1 root root 1112 May 3 12:00 mongodb.conf
                  -rw-r--r--. 1 root root 174 May 3 12:00 mqtt.conf
                  -rw-r--r--. 1 root root 2101 May 3 12:00 mysql.conf
                  -rw-r--r--. 1 root root 1700 May 3 12:00 oracle.conf
                  -rw-r--r--. 1 root root 2723 May 3 12:00 postgres.conf
                  -rw-r--r--. 1 root root 1174 May 3 12:00 redis.conf
                  -rw-r--r--. 1 root root 388 May 3 12:00 smart.conf

                  Last edited by bab; 22-05-2022, 21:55.

                  Comment

                  • Markku
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                    • Sep 2018
                    • 1781

                    #10
                    I have no experience in agent2, but https://www.zabbix.com/documentation...gent-2-plugins says about some changes in 6.x.

                    Try to edit the path in the Include statement in zabbix_agent2.conf to /etc/zabbix/zabbix_agent2.d/plugins.d (ie. add the full path to the plugins config directory instead of the relative path).

                    Markku

                    Comment

                    • dslauter
                      Junior Member
                      • Jun 2022
                      • 1

                      #11
                      Hi bab I ran into the same issue, the way to fix it is to comment out the include in the bottom of the agent2 config file.

                      Code:
                      Include=./zabbix_agent2.d/plugins.d/*.conf
                      Alternatively you could edit that line to contain the full path to the plugins.d conf file.

                      Comment

                      Working...