leoplocicki

Connecting and logging into a .net session on the local machine

Discussion created by leoplocicki on Nov 13, 2012
Latest reply on Nov 15, 2012 by leoplocicki

Hi,

 

I'm trying to get an app working that connects to the controller, gets the hub name, then goes through the config file of the net_connect probe and writes values to the snmpget probe. I'm using c# to do this.

 

The problem is, I can't get the code to login to the session using the provided example code.

I've tried connecting to the session like this:

 

session = new NimbusSession("localhost", (int)NimbusPort.Controller);

session = new NimbusSession("localhost/controller", (int)NimbusPort.Controller);

session = new NimbusSession("localhost", "127.0.0.1", (int)NimbusPort.Controller);

 

And logging in like this:

 

session.Login("administrator", "password", true);

session.Login("administrator", "password", false);

 

and I can't find a combination that works.

 

I either get the attached error or this one:

 

Unhandled Exception: Nimsoft.NimBUS.NimException: Failed to log in. Check user n
ame and password. ---> Nimsoft.NimBUS.NimException: Failed to connect. ---> Syst
em.ArgumentNullException: Value cannot be null.
Parameter name: host
   at System.Net.Sockets.Socket.Connect(String host, Int32 port)
   at Nimsoft.NimBUS.Messaging.NimbusSession.Connect(Int32 timeout)
   --- End of inner exception stack trace ---
   at Nimsoft.NimBUS.Messaging.NimbusSession.Connect(Int32 timeout)
   at Nimsoft.NimBUS.Messaging.NimbusSession.SendMessage(NimbusMessage message,
String custom1, String custom2, String custom3, String custom4, String custom5)
   at Nimsoft.NimBUS.Security.Login.LoginRequest(NimbusSession session, String r
equest, PDS data)
   at Nimsoft.NimBUS.Security.Login._userLogin(String user, String password, Str
ing controllerIp, NimbusSession session, Logger logger)
   --- End of inner exception stack trace ---
   at Nimsoft.NimBUS.Security.Login._userLogin(String user, String password, Str
ing controllerIp, NimbusSession session, Logger logger)
   at Nimsoft.NimBUS.Security.Login.UserLogin(String user, String password, Nimb
usSession session, Logger logger)
   at Nimsoft.NimBUS.Messaging.NimbusSession.Login(String user, String password,
 Boolean onServer)
   at snmpget_process.snmpget..ctor(String com_server_string, String com_network
_string) in D:\Development\AnalyzeNimsoftConf\snmpget_process\snmpget.cs:line 72
7
   at snmpget_process.Program.Main(String[] args) in D:\Development\AnalyzeNimso
ftConf\snmpget_process\Program.cs:line 21

 

 

 Any Ideas?

 

Thanks,

Leo

Attachments

Outcomes