Forum Discussion
Wade_98751
Nimbostratus
Aug 15, 2008Having .initialize issues
Good morning,
Need some assistance initializing (objIControl.initialize) as it fails to return true. I downloaded the iControlAssembly and ran the testclient which also returns the error 'not initialized' from the command prompt. This tells me known good code is having the same issue as my code.
What is strange is that I can log into the big ip's cgi URL from the same server I'm running the code from, the CGI URL returns the data I'm looking to use. This tells me that the network connectivity is good and my credentials work to access the BIP's API. Using IE 7.0 I'm prompted to accept the issue with the big ip's local certificate and then I'm challenged for credentials. Do you think having to acknowledge the certificate issue is causing the code to fail?
Below is the VB .net code I'm testing connectivity with in VS 2008. I also have issues initializing the icontrol object from C code shown on DevCentral. Any guidance on how to fix this issue would be greatly appreciated. After successfully initializing the connection I'm looking to disable pool members one by one as we institute a weekly scripted reboot job on our Windows 2003 server web farm.
Thanks for your assistance!
Wade
https://" + bigip_address + "/iControl/iControlPortal.cgi
Basic VB .net code I'm using to test the iControl object:
Module Module1
Sub Main()
Dim objIControl As New iControl.Interfaces
Dim arrPoolList As Array
Dim isGood As Boolean
isGood = objIControl.initialize("172.16.200.8", 443, "adminuser", "adminuserpass", "proxy.contoso.com", 8080, "proxyuser", "proxyuserpass")
'arrPoolList = objIControl.LocalLBPool.get_list
'For x = LBound(arrPoolList) To UBound(arrPoolList)
'Console.WriteLine("Pool name = " & arrPoolList(x))
'Next x
End Sub
End Module
20 Replies
- Don_MacVittie_1Historic F5 AccountHi Wade,
Just starting with the easy stuff, did you check that the version of the .NET Framework on the machine is in line with the assembly requirements? If so we'll move on, but I like to check the easy bit first :-).
Don. - Wade_98751
Nimbostratus
Hey Don,
I have 1.0, 1.1.4, 2.0, 3.0,3.5 installed on my 2003 dev server. The VB project I loaded in VS 2008 to test the code out in is using both 2.0 and 3.5 depending on which dll is being referenced. Check out the attached document for screen shot of the program's dll's framework version being referenced. What dot framework is the sample testlclient using which i downloaded from devcentral? The testclient also receives the not initialize error.
Thanks!
Wade - Don_MacVittie_1Historic F5 AccountOkay, one down. I don't maintain it, but Joe told me once it requires 2.0 or later.
My next suggestion would be to try accessing it with the SDK samples (as opposed to the assembly, which masks exceptions)... you can download it here: http://devcentral.f5.com/wiki/default.aspx/iControl/F5Downloads.html and I would simply download it, install it, and build one of the samples per the instructions, then run it.
At least with this version if it errors out it will tell you why it did. We could try guessing at it and checking things like connectivity and SSL transport, but better to just let the API tell you what went wrong.
Let us know how it goes!
Don. - Wade_98751
Nimbostratus
Don,
I had tried that earlier. I ran the testclient app which came with the assembly and recieved the "Not Initialized" error. Basically the same issue my VB code is having.
Ideas? I'm still stuck. - Don_MacVittie_1Historic F5 AccountHey Wade,
I meant the actual API - the Assemblies are wrappers over the API. Try downloading the API here: http://devcentral.f5.com/wiki/default.aspx/iControl/F5Downloads.html
At the top of the page are the APIs, below them are the wrappers.
What happens with the assemblies is that they make API calls and catch Exceptions, so "Not Initialized" is the assembly's way of saying "there was an Exception, I caught it, but we can't connect". By downloading the core API and building one of those samples, there won't be anything to catch the exception and you can see what's actually going on.
Hope that helps!
Don. - Wade_98751
Nimbostratus
Hi Don,
I downloaded the API and ran the VB sample "Pool.exe" with the bip ip's IP address, username and password. The pool.exe returned the error "The remote server returned an error: (407) Proxy Authentication Required. This does return some results when Googling the error which I need to see if they apply to my situation.
Looking at the command line arguments for pool.exe I can't pass my proxy values to it. Although, the VB code I wrote did pass proxy address, port, username and password as parameters and that code would not initialize either.
thanks for your help,
Wade - Wade_98751
Nimbostratus
I was reading the iControl Quickstart Guide for .NET and noticed the blurb below but I dont have access to the link to configuring 'Configuring .NET SSL Security in a Trusted Environment'. This looks important and seems like I may need to do this for my development environment.
How do i get access to the article?
'start blurb'
Configuring .NET Security
To configure the client environment in .NET to allow communication with servers using un-trusted or self-signed server certificates, see the article Configuring .NET SSL Security in a Trusted Environment on this site.
'end blurb'
error received:
You do not have access to view this tab within the portal. - Don_MacVittie_1Historic F5 AccountHi Again Wade,
Odd... I can see it as a not-even-logged-in user, both from my laptop and my Blackberry.
I hate to ask this, but can you try again by going here: http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=4
If the direct link takes you there, then there's something broken with the links you followed and we'll need to figure that out. If it doesn't work for you, we'll have to look elsewhere for the problem.
Thanks,
Don. - Wade_98751
Nimbostratus
Yes, the direct linked worked. sorry to bother with stupid PEBKAC questions.
Also, great news, I compiled the SDK code as you suggested and made my first successful connection to the BIG IP. I loaded the VB .Net project 'iControl-9.6.0\sdk\samples\soap\vb\microsoft\LocalLB\Pool' and built a pool.exe which connected successfully from a command prompt once I learned the proper parameters to pass it. I'm so stoked.
My next steps are to look at the pool.vbproj and see what code I can use to make a connection to the big ip and gracefully shutdown a node. It's definately a lot more complicated to get the initialize connection up and running in C or VB .Net than this article leads you to believe http://devcentral.f5.com/Default.aspx?tabid=68. I wish it were as simple as only adding a reference iControl.dll to a vb or c project. Let me know how I missed the bus here if you can.
My main goal is to integrate that code call into VBScript if possible to work inconjunction with a weekly IIS 6.0 web server reboot job we run after hours. The code is important because we want to stop connections to the web application gracefully before we reboot. There's a similar app written out on the devcentral site but its written in perl http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=254.
I'm not sure if I'll be able to instantiate the iControl objects from a vbscript. If not, I'll write something similar to the pool.exe in VB .Net and use WMI to start the pool.exe process remotely and pass it parameters so I can keep the whole process automated.
Let me know if you know a more succinct way to accomplish my goal.
Thanks for your ideas and assistance! - Don_MacVittie_1Historic F5 AccountHey Again,
I am going to ping Deb at her new role, she sometimes answers these questions with things like "oh. You can just configure a monitor to do that!" I don't think that will be the case here, but I'll check to be sure.
The document you're reading assumes the assembly is being used, not the core API - we wrote the assemblies and the Java Wrappers to make using the API easier, and you're feeling that difference.
I've never tried to hit iControl from VBScript, I think you just gave me a tech tip to research. While it should be possible, I'll go toy with the how. If you can use powershell, this should be done for you - Joe has written a lot of great powershell stuff, but you'd have to have PS installed.
I'll check back when I hear from Deb.
Don.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
