0

I want to connect to a Linux server and read some logs from a folder located in the Linux server through a program written in VB.net.

Is it possible or do I need to have some extra tools or softwares to do the above. (not through Putty or anything similar to it)

Automation Requirements: Go to a folder located in Linux server. Check for a log file. If there are no log files created today then send a mail to me.

I need to write a vb program in VS-2005 to do the above task. Can someone give me a head start or how to go about it.

I am new to Vb programming so any help would be appreciated.

i can neither use SSH protocols nor sockets to do it.For both i would have to install something or the other for which i do not have privileges. Can anyone tell me how can i do it using putty or filezilla tools. I have both available but do not know how to access them through vb programming.

Thanks

user2281731
  • 13
  • 1
  • 5
  • Do you actually need the contents of the log file, or do you just need to check for its existence? In the latter case, I'd be more in favor of making a simple cron job on the Linux server itself. Or if the Linux server is configured as a web server, make a simple RSS feed in Perl or PHP there. Unless this whole VB idea is forced upon you? – Ruud Helderman Jan 27 '14 at 10:15
  • @Ruud i just need to check its existence and yes the VB idea is forced upon me. Can't help it there. – user2281731 Jan 27 '14 at 10:19
  • About this authority that's forcing you in a particular direction: does it even give you any freedom of choice regarding the type of connection? SSH (as proposed by user3184706) or HTTP (that might make my RSS idea possible)? What about the server's configuration, and your freedom in reconfiguring it? Open ports, install a webserver... – Ruud Helderman Jan 27 '14 at 11:28
  • @Ruud.. The Server type is SFTP-SSH File Transfer Protocal. Have to connect using some credentials...Open ports.. – user2281731 Jan 27 '14 at 12:11
  • You may want to try SSH.NET. Take a look at the answers here: http://stackoverflow.com/questions/11781808/sftp-ssh-net-dll-instead-of-sharpssh – Ruud Helderman Jan 27 '14 at 12:42
  • @Ruud.. Is SSh.net Library only available for C# and not Vb. I downloaded the SSh.NET Library but the solution file is a csproj. I am using VS2005 which does not include C#. So i cannot run a csproj. It only supports vbproj files. Any help here... – user2281731 Jan 28 '14 at 08:56
  • VB.NET and C# compile to the same Common Intermediate Language; they work along just fine. If you have the opportunity, (re-)install Visual Studio with C#. If you can't, then just download SSH.NET as a binary (.dll). Take the version that's closest to (but not above) your .NET runtime version. http://sshnet.codeplex.com/releases/view/104648 – Ruud Helderman Jan 28 '14 at 10:39
  • @Ruud I am working with very limited resource here, also have very few privileges. Anyways i have dropped the idea of using the SSh.net library, so will try to pass commands directly to putty through vb to get the job done. Any idea how should i get about it? Thanks.. – user2281731 Jan 29 '14 at 08:13

1 Answers1

0

You need to find a way to connect linux machine by SSH protocol Please refer this post for your reference executing commands on unix server via visual basic application

Community
  • 1
  • 1
Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
  • i can neither use SSH protocols nor sockets to do it.For both i would have to install something or the other for which i do not have privileges. Can you tell me how can i do it using putty or filezilla tools. I have both available but do not know how to access them through vb programming. – user2281731 Jan 30 '14 at 10:19
  • There is project named superputty which uses putty for connecting remote machine,Please refer http://code.google.com/p/superputty/ and take referance of superputty's code. – Rahul R Dhobi Jan 30 '14 at 10:47