ktelep / Zabbix-DellEMC-PowerMax

4 stars 2 forks source link

Register multiful PyU4V ip(Server ip) in PyU4V.conf #2

Open ycircle86 opened 1 year ago

ycircle86 commented 1 year ago

I need to register multiple unsphere ips as a configuration feature. If there is a way, please share for me.

rawstorage commented 1 year ago

Currently the configuration can only hold one connection. However you can create as many as you like in your own code with variables for each connection.
api = PyU4V.U4VConn( username='smc', password='smc', server_ip='unisphere1', port='8443', array_id='000297901493', verify=False) api2 = PyU4V.U4VConn( username='smc', password='smc', server_ip='Unisphere2', port='8443', array_id='000297901494', verify=False)

Alternatively if you have multiple arrays visible to your Unisphere you can change the focus of the API to different array using the set array function

api.set_array_id( array_id="000297901495")

ycircle86 commented 1 year ago

Hi Paul Thank you so much your answer.

Without some settings in PyU4V.conf, Can I use variables(ex> api) for Connetion of multiple Unispheres?

For example, my PyU4V.conf is configured like this.

appuser@khzbxstodtw01[/appdata/appuser/PyU4V]cat PyU4V.conf [setup] ; enter the below details - mandatory ;(can be passed as parameters on initialisation also) username=smc password=smc server_ip=12.56.209.241 port=8443 array=000297000149 ; remote_array=00012345679 ; verify=True ; verify=/path-to-file/server_hostname.pem verify=False

At Python prompt, Do I enter your cord?

appuser@ykim01 [/appdata/appuser/PyU4V]python3 Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information.

api = PyU4V.U4VConn( username='smc', password='smc', server_ip='unisphere1', port='8443', array_id='000297901493', verify=False) api2 = PyU4V.U4VConn( username='smc', password='smc', server_ip='Unisphere2', port='8443', array_id='000297901494', verify=False)

and then, If run , test_PyU4V.py, Can I identfy connection result(of 3 Unisheres?

12.56.209.241, unisphere1, Unisphere2

i will wait for your reply, please.

rawstorage commented 1 year ago

Hi, You don't need to do anything at the python prompt unless your script is setup to take user input, in which case you could pass in variables, there are ways to do this in python but it's not the responsibility of PyU4V. For PyU4V in your scripts you can change the Ip address in the connection string via variable or you can setup multiple connections, how you do this is really up to you.

Hope this helps.

From: ycircle86 @.> Sent: 22 June 2023 11:01 To: ktelep/Zabbix-DellEMC-PowerMax @.> Cc: Martin, Paul @.>; Comment @.> Subject: Re: [ktelep/Zabbix-DellEMC-PowerMax] Register multiful PyU4V ip(Server ip) in PyU4V.conf (Issue #2)

[EXTERNAL EMAIL]

Hi Paul Thank you so much your answer.

Without some settings in PyU4V.conf, Can I use variables(ex> api) for Connetion of multiple Unispheres?

For example, my PyU4V.conf is configured like this.

@.***[/appdata/appuser/PyU4V]cat PyU4V.conf [setup] ; enter the below details - mandatory ;(can be passed as parameters on initialisation also) username=smc password=smc server_ip=12.56.209.241 port=8443 array=000297000149 ; remote_array=00012345679 ; verify=True ; verify=/path-to-file/server_hostname.pem verify=False

At Python prompt, Do I enter your cord?

@.*** [/appdata/appuser/PyU4V]python3 Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information.

api = PyU4V.U4VConn( username='smc', password='smc', server_ip='unisphere1', port='8443', array_id='000297901493', verify=False) api2 = PyU4V.U4VConn( username='smc', password='smc', server_ip='Unisphere2', port='8443', array_id='000297901494', verify=False)

and then, If run , test_PyU4V.py, Can I identfy connection result(of 3 Unisheres?

12.56.209.241, unisphere1, Unisphere2

i will wait for your reply, please.

- Reply to this email directly, view it on GitHub [github.com]https://urldefense.com/v3/__https:/github.com/ktelep/Zabbix-DellEMC-PowerMax/issues/2*issuecomment-1602360157__;Iw!!LpKI!gZNF1pJBr4LxQkqZF87ZBFFKIBsf7xQv25FL7RyUdb81Aktd-0sBwlkbV5NNq9jXtjF_CPRoL7IMZG2REoQqCuIl$, or unsubscribe [github.com]https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AF7FWPOOBHAA5BU72QZ7MT3XMQJWVANCNFSM6AAAAAAZI3FUFM__;!!LpKI!gZNF1pJBr4LxQkqZF87ZBFFKIBsf7xQv25FL7RyUdb81Aktd-0sBwlkbV5NNq9jXtjF_CPRoL7IMZG2REsMH9xlR$. You are receiving this because you commented.Message ID: @.**@.>>

Internal Use - Confidential