How to monitor output of any command on Linux machine for free? With Trafikito.

How to monitor output of any command on Linux machine for free? With Trafikito.


With Trafikito you can monitor the output
of any command. Now, let me show you one of the ways how to
do it. I will use the pm2 prettylist command to take
a number of RAM used by the active NodeJS process. Let’s go to the dashboard and click the
plus sign to add a new server. So, click on the code to copy it and then
paste it in your server. After installation, you will see a new server
on the dashboard. Next, open the detailed view. I need to add a new data source. Here you can see the current list of the available
commands. Let’s add a new one called pm2_memory. To organize it I’m creating a folder for
all the customized thing. This file will contain relevant data. The pm2 prettylist command returns a lot of
data so to save bits, I’m using grep. Now the output is short and clean. Then, I will use crontab to update the data
file. Trafikito agent will use the cat command to
get the contents of the file. Let’s add a new command for Trafikito agent. We will start seeing this command on the dashboard
after the next data cycle. After a minute, open settings and click the
plus sign to add a new data source. Select the pm2_memory command from the dropdown
and save. On the next cycle, Trafikito agent will send
the output for this data source. After a minute the output is visible. Data parsing will extract the needed number
from the output. Just add a new variable and select the B1
cell which contains ram usage in bytes. Select the display type “Base” for a better
visual representation, then save and close the settings. I want to see data on my dashboard. Enter edit mode, add a new block and make
some space for it. Then, put it into position and click the pencil
to edit it. Select a new variable to display in this chart. Make any settings adjustment you like and
save. Notice that you can use variables inside settings. Turn off the edit mode and there you have
it. A new chart with custom data is now available. I used crontab and proxy file for this example
but Trafikito agent can run any commands it has access to. Please ask any questions in comments or send
an email to [email protected]