• We did not send an email asking for donations - please read this post.

Visual Basic application

josephchrzempiec

New Member
Joined
Nov 16, 2019
Messages
1
Reaction score
0
Credits
0
Hello As I'm starting to work with linux more but still new to the whole linux programming. I work with windows base visual basic programming. the application I'm trying to make is for status of the system while in linux. What would be the best to get started to monitoring system status using ubuntu in visual basic?


Joseph
 


arochester

Moderator
Staff member
Gold Supporter
Joined
Apr 25, 2017
Messages
1,677
Reaction score
1,339
Credits
3,385
What exactly do you wish to monitor?
 

JulienCC

Active Member
Joined
Oct 7, 2019
Messages
235
Reaction score
207
Credits
0
Hello,

I'm going to assume we are talking about VB.NET and not VB 6 (the one used for excel macros).

I you want to write some VB code on Linux you can use the IDE you want. From Gedit to Bluefish, VIM or BASH.

In order to compile VB.NET code you will need a vb compiler (vbnc) and in order to run what's been compiled you will need a mono runtime env (mono).

Here is the way to install them on debian, it should work the same on ubuntu:
Code:
# apt install mono-runtime mono-vbnc

Example of usage :

Write this code to a "test.vb" file :
Code:
Module mainModule
    Sub Main()
        MsgBox("The Main procedure is starting the application.")
        ' Insert call to appropriate starting place in your code.
        MsgBox("The application is terminating.")
    End Sub
End Module

Compile it :
Code:
$ vbnc test.vb

Then run it :
Code:
$ mono test.exe

What would be the best to get started to monitoring system status using ubuntu in visual basic?

If you want to monitor your system with this you should use the /proc file hierarchy https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html.
The first thing would be to keep a list of the running processes, the resources they use... Anything you can grab from /proc. Then you compare what you grabbed at some point to what is actually running. For example you can get a notification when a program is run for the first time, or if the executable path changed... You can set any "normal situation" parameter you want and set alarms when things are unusual.

The other place where you can find interesting things is /sys https://github.com/torvalds/linux/blob/master/Documentation/filesystems/sysfs.txt

You can track changes in /dev too.

There are many utilities on linux to monitor specific things. You could use them too with some process calls https://docs.microsoft.com/fr-fr/dotnet/api/system.diagnostics.process?view=netframework-4.8 :
ss (command for network stuff)
smartctl (smartmontools packet, allows you to monitor hard drives health)
lsmod (list loaded kernel modules, allows you to detect crashed or added hardware)
sysctl/journalctl (monitoring things started with systemd)
...
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top