SSH And Sftp in C#
Posted on 2010-11-08
I have a question about SSH and Sftp..
We are going to build a Client that collects data about the system... Cpu Usage, Disk usage, memory and further on.. This has to be sent to a SSH server via Sftp. This is done through C# via a libary(Chilkat) and works very well.. I use Cygwin as SSH server on 2003 R2 x64.
The collected data has to be submitted to our SQL server database and We have a website which is connected to this database and our customer can see these data via a website.
I have a pretty good idea how i shall do this, but i want to get some advise(s) from you.
My plan is as follows:
1. Collect the data on the client. Create a Sftp connection to the SSH.
2. Create the file on the server and write to it.
The file has some parameters(clientname, servername, and data category(for example CPU Data).
3. A FileSystemWatcher service is writting in C# and looks in these folders where the data is uploaded. The FileSystemWatcher has code that has the Regex Class to look for Patterns(Data category,Client name, servername).
4. These data is submitted to the database by the patters that is corrosponding to the patterns.. For Example Client name pattern is submitted into the Client_Name Column in the Database and so on..
This sounds very simple, but i don't think so hehe :)
Do some of you now how to add users to Cygwin SSHD?
This is in C# and the client has a service scheduler that is determind by the end user when to upload and what to upload.