Forum Discussion
Srinivasan_Reng
Nimbostratus
Aug 16, 2005Connecting to BIP IP and testing
Hello
Can anyone help me please.
I have problem in connecting my devices to BigIP
Devices Connected
=================
The Big IP, PC and my laptop are connected.
I developed a small windows application (using C)based on the Video demo.
Url :
=====
http://devcentral.f5.com/Default.aspx?TabID=29&newsType=ArticleView&articleId=19
The code is pretty much the same as the above and I fine tuned a little bit.
When I compile it is fine. It Opens the dialog( asking for Hostname, Username and Password).I provided the same.
I am unable to get the list of nodes in the checkbox when i click the Button.
Error:
=====
“The request failed with HTTP status 404: Not Found. Access Denied”
What could be possible problems kindly let me know.
Here is the complete code:
===========================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Security.Cryptography.X509Certificates;
namespace LocalLB
{
public class Form1 : System.Windows.Forms.Form, System.Net.ICertificatePolicy
{
private System.Windows.Forms.Label lbl_Hostname;
private System.Windows.Forms.TextBox tb_hostname;
private System.Windows.Forms.CheckedListBox lb_nodes;
private System.Windows.Forms.Button b_getlist;
private System.Windows.Forms.TextBox tb_username;
private System.Windows.Forms.TextBox tb_password;
private System.Windows.Forms.Label Username;
private System.Windows.Forms.Label password;
WindowsApplication1.Node.ITCMLocalLBNode node = new
WindowsApplication1.Node.ITCMLocalLBNode();
System.Net.NetworkCredential creds = new
System.Net.NetworkCredential();
private void InitializeComponent()
{
this.lbl_Hostname = new System.Windows.Forms.Label();
this.tb_hostname = new System.Windows.Forms.TextBox();
this.lb_nodes = new System.Windows.Forms.CheckedListBox();
this.b_getlist = new System.Windows.Forms.Button();
this.tb_username = new System.Windows.Forms.TextBox();
this.tb_password = new System.Windows.Forms.TextBox();
this.Username = new System.Windows.Forms.Label();
this.password = new System.Windows.Forms.Label();
this.SuspendLayout();
this.lbl_Hostname.Location = new System.Drawing.Point(16, 56);
this.lbl_Hostname.Name = "lbl_Hostname";
this.lbl_Hostname.TabIndex = 0;
this.lbl_Hostname.Text = "HostName";
//
// tb_hostname
//
this.tb_hostname.Location = new System.Drawing.Point(128, 56);
this.tb_hostname.Name = "tb_hostname";
this.tb_hostname.TabIndex = 1;
this.tb_hostname.Text = "";
//
// lb_nodes
//
this.lb_nodes.Location = new System.Drawing.Point(8, 160);
this.lb_nodes.Name = "lb_nodes";
this.lb_nodes.Size = new System.Drawing.Size(120, 94);
this.lb_nodes.TabIndex = 2;
//
// b_getlist
//
this.b_getlist.Location = new System.Drawing.Point(248, 88);
this.b_getlist.Name = "b_getlist";
this.b_getlist.TabIndex = 3;
this.b_getlist.Text = "Get_List";
this.b_getlist.Click += new System.EventHandler
(this.b_getlist_Click);
//
// tb_username
//
this.tb_username.Location = new System.Drawing.Point(128, 88);
this.tb_username.Name = "tb_username";
this.tb_username.TabIndex = 4;
this.tb_username.Text = "";
//
// tb_password
//
this.tb_password.Location = new System.Drawing.Point(128, 120);
this.tb_password.Name = "tb_password";
this.tb_password.TabIndex = 5;
this.tb_password.Text = "";
//
// Username
//
this.Username.Location = new System.Drawing.Point(16, 88);
this.Username.Name = "Username";
this.Username.TabIndex = 6;
this.Username.Text = "UserName";
//
// password
//
this.password.Location = new System.Drawing.Point(16, 120);
this.password.Name = "password";
this.password.TabIndex = 7;
this.password.Text = "Password";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(488, 266);
this.Controls.Add(this.password);
this.Controls.Add(this.Username);
this.Controls.Add(this.tb_password);
this.Controls.Add(this.tb_username);
this.Controls.Add(this.b_getlist);
this.Controls.Add(this.lb_nodes);
this.Controls.Add(this.tb_hostname);
this.Controls.Add(this.lbl_Hostname);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
System.Net.ServicePointManager.CertificatePolicy = this;
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
//private string sHostName = "";
private string sPort = "";
private string Url;
/*void updateConnectionInfo()
{
string sProtocol = "https";
if ( sPort.Equals("80") || sPort.Equals("8080") )
{
sProtocol = "http";
}
Url = sProtocol + "://" + sHostName + ":" + sPort + "/iControl/iControlPortal.cgi";
}*/
private void b_getlist_Click(object sender, System.EventArgs e)
{
creds.UserName = tb_username.Text;
creds.Password = tb_password.Text;
node.PreAuthenticate =true;
lb_nodes.Items.Clear();
WindowsApplication1.Node.ITCMCommonIPPortDefinition [] node_defs = null;
sPort = "80";
string sProtocol = "https";
if ( sPort.Equals("80") || sPort.Equals("8080") )
{
sProtocol = "http";
}
Url = sProtocol + "://" + tb_hostname.Text + ":" + sPort + "/iControl/iControlPortal.cgi";
try
{
node.Url = Url;
node.Credentials = creds;
node_defs = node.get_node_server_list();
}
catch( Exception ex )
{
Console.Write( ex.Message );
}
int [] state = node.get_state_ex(node_defs);
for(int i=0; i{
lb_nodes.Items.Add(node_defs.address + ":" +
node_defs.port.ToString(),
Convert.ToBoolean(state));
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
public bool CheckValidationResult(System.Net.ServicePoint srvPoint, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Net.WebRequest request, int certificateProblem)
{
return true;
}
}
}
// The End //
- First thing: have you tested out any of the included sample C applications in the SDK? I'd try to compile them first to make sure that connection to your BIG-IP and authentication is correct.
sPort = "80"; string sProtocol = "https"; if ( sPort.Equals("80") || sPort.Equals("8080") ) { sProtocol = "http"; } Url = sProtocol + "://" + tb_hostname.Text + ":" + sPort + "/iControl/iControlPortal.cgi";
- Srinivasan_Reng
Nimbostratus
I tried this : - Srinivasan_Reng
Nimbostratus
I got connected to BigIP. Thanks. - Are you sure you are connecting to the BIG-IP management port with your tb_hostname value? The ending URL should be something like this:
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