Network Monitoring Software

Good morning to everybody : i’m a new italian user of mate linux distribution and i have a lot of problem to solve.
First i beg your pardon for my poor english, second i hope you don’t worry about my simple question.

I have installed a software called “network traffic monitor”, downloadable at this link.

It helps me to control my LTE 4G connection : i have only 8 GB at month from 8.00 to 24.00, but free from 00 to 7.59.

So i want to track data usage by that soft in the morning, but i need to stop it at 00.00 and restart at 8.00 every day.

I think that i coul use crontab file to make it, bu i don’t know how can i kill -9 it because doesn’t appear in service info.

Someone can help me ?

Many thanks in advance.

When it is running, is there some indication, such as an open application window, or a system tray icon, to let you know it is running? If so, then have you simply tried the command “killall <application-name>” in a terminal to see if it kills it?

1 Like

ok, this evening i try and replay output: thank you!

Hi @marcoxmate,

I have no clue as to whether this is what you want but it won’t hurt to read through the link!:

http://www.zabbix.com/whats_new

There are .deb packages here:

http://www.zabbix.com/download

You can try it out!. :thumbsup:

Thanks, i visit, but it doesn’t satisfay my problem. The soft i get by ny link works properly, in system tray, only i must have to kil manually!

Thanks, i try to kill it , but nothing: also by command pidoff not appear PID ( instead for firefox for example works very well !)
The soft was made in python and author said that work in system tray.
Any ideas?

I am not sure I have understood what you have written here. Are you saying that after using the "killall" command on the application, it was still running? If it was, are you sure you are using the correct application-name in the killall command? To that end, right-click your main menu and choose "edit menu". One in your menu editor, navigate to the application entry and double click it. This will bring up a small dialog box that will show the command to run the application. As an example, see below:

From the above, it can be seen that the command for this application is "bleachbit". So, to kill this application, if it is running, I would need to use the command "killall bleachbit"

Yes, i confirm that is still running

ok, i undertood, so this evening, when i will return at home i’ll try.
many thanks

Good evening, i got not response from terminal and ntm software doesn't stop. Sigh!

Hello again marcoxmate. I have down loaded and installed the ntm deb from here:

https://sourceforge.net/projects/netramon/files/latest/download?source=files

However, like you, I cannot find a way to kill it from the terminal. Which is very odd. However, I think there may be a workaround available using a program called xmacro. This is a program that records actual desktop activity as a macro which can then be replayed, and so re-enact whatever the action that was taken during the recording.

It may be possible to make a macro recording of manually stopping NTM. Then, replay this macro with a bash script which can then be invoked using your other bash script that you are wanting to construct that turns ntm on and off at certain times. I am going to have a go at making this macro now and, if it works, then I will come on here and explain exactly how to do it.

Okay, I have just tried using xmacro to close ntm it and it works!

So, I need to go away and make a video and written instructions and will post them on here sometime later today.

You are an angel run to me from the sky!! Many thanks in advance.

Okay. Here is how to use xmacro to close ntm.

  1. install xmacro:

sudo apt-get install xmacro

  1. run ntm and check it is running in the system tray

  2. open a terminal and type the following command:

xmacrorec2 > stop-ntm.txt

When you run that above command, it will appear to do nothing. That is because it is waiting for you to press any key. Once you have pressed that key, it will go into "record" mode. It will keep recording all actions you take on your desktop until you press that key again. At which point, the recording will stop. I usually just use the "esc" key for this purpose. After you have pressed the "esc" key for the first time, simply move your mouse cursor to the ntm system tray icon and right-click it to bring up its menu. Then left-click on "Quit". when ntm has closed, then click back in your terminal where you are running xmarco and press the "esc" key. This will stop xmacro and will save it's output as a text file in your home folder.

  1. Open pluma text editor and paste the following command into it

xmacroplay "$DISPLAY" < stop-ntm.txt

Save and close the file as "stop-ntm.sh"

You will now find you have two extra files in your home folder. "stop-ntm-txt" and "stop-ntm.sh"

See below:

  1. Open caja and right click the "stop-ntm.sh" file and choose "properties" Go to the "permissions" tab and check the "allow executing file as program" checkbox. See below:

Then close the "properties" dialog box.

Now to test the above script:

a) close any instances of ntm that may be open

b) open ntm

c) double click the "stop-ntm.sh" bash script that you have created in your home folder. Choose "run". See below:

You should now find that NTM should close and will disappear from your system tray.

You can now invoke the above "stop-ntm.sh" file in any other bash script with the following command

sh stop-ntm.sh

If you need me to make a video of how to do all of the above, let me know and I will produce one.

1 Like

Actually, I have just been thinking about it and, on reflection, you may not even need to make the “stop-ntm.sh” bash script. Instead, in the bash script you are creating to run ntm on and off at certain times, you may be able to simply put the following command in it whenever you want ntm to close:

xmacroplay "$DISPLAY" < stop-ntm.txt

ok, i think what you explaine it’s complete: in the next hour i try your method, then i reply to you if i need video. thank you and good evening!

Okay, I have found a GUI for cron so that you can run NTM on and off. It is called "gnome-scheduler". It was included in Ubuntu until 16.04, where they stopped including it in the repositories for some incomprehensible reason. However, I have found a deb that has been compiled by someone for 16.04 and it can be downloaded from here:

https://bugs.launchpad.net/ubuntu/+source/gnome-schedule/+bug/1576060/+attachment/4701008/+files/gnome-schedule_2.3.0-0ubuntu16.04_amd64.deb

It will open in gdebi and can be installed from there. It does not appear to have a menu entry following initial installation. So, you must run it with the following terminal command:

gnome-schedule

Or, if you log out and then back in, it will appear in the menu under system/tools/scheduled tasks

You can run repetitive tasks with gnome-schedule and so can tell it to run ntm at a certain time and then stop ntm at another time. If you look at my original instructions, you should now only need to go to instruction 3 and then do the following:

i) open gnome schedule and start a new task by selecting "new". Choose "a task that launches recurrently".

ii) in the "command" field, type "ntm". Set it to "every day" (or whenever you want) and then click "advanced" and set the hours/minutes etc. when you are done, click the "add" button. It should now appear in your list of cron jobs

iii) add a new job. but, this time, in the command field, paste the following command into it:

xmacroplay "$DISPLAY" < stop-ntm.txt

Then set the time of the job as before

See below:

That should do it for you.

2 Likes