Monitoring server bandwidth

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to collect bandwidth usage statistics on my linux server.
What I want to do, is to write a function (probably will use php exec) that will return the number of bytes, and then store it in DB.



I had tried several methods, but all return complex data.
Is there a method to get simple bandwidth usage in bytes for the server.
I don't need to know which ip or service using it.

I need only in going and out going usage.







share|improve this question















  • 1




    Use ifconfig command for TX and RX bytes.
    – Ipor Sircer
    Jun 21 at 16:09














up vote
1
down vote

favorite












I want to collect bandwidth usage statistics on my linux server.
What I want to do, is to write a function (probably will use php exec) that will return the number of bytes, and then store it in DB.



I had tried several methods, but all return complex data.
Is there a method to get simple bandwidth usage in bytes for the server.
I don't need to know which ip or service using it.

I need only in going and out going usage.







share|improve this question















  • 1




    Use ifconfig command for TX and RX bytes.
    – Ipor Sircer
    Jun 21 at 16:09












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to collect bandwidth usage statistics on my linux server.
What I want to do, is to write a function (probably will use php exec) that will return the number of bytes, and then store it in DB.



I had tried several methods, but all return complex data.
Is there a method to get simple bandwidth usage in bytes for the server.
I don't need to know which ip or service using it.

I need only in going and out going usage.







share|improve this question











I want to collect bandwidth usage statistics on my linux server.
What I want to do, is to write a function (probably will use php exec) that will return the number of bytes, and then store it in DB.



I had tried several methods, but all return complex data.
Is there a method to get simple bandwidth usage in bytes for the server.
I don't need to know which ip or service using it.

I need only in going and out going usage.









share|improve this question










share|improve this question




share|improve this question









asked Jun 21 at 15:23









matisa

306




306







  • 1




    Use ifconfig command for TX and RX bytes.
    – Ipor Sircer
    Jun 21 at 16:09












  • 1




    Use ifconfig command for TX and RX bytes.
    – Ipor Sircer
    Jun 21 at 16:09







1




1




Use ifconfig command for TX and RX bytes.
– Ipor Sircer
Jun 21 at 16:09




Use ifconfig command for TX and RX bytes.
– Ipor Sircer
Jun 21 at 16:09










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










See if this will work for you.



This will list the received bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $3'


This will list the sent bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $8'


If you need for other interfaces you can change the name.






share|improve this answer





















  • This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
    – matisa
    Jun 21 at 17:02










  • The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
    – MUY Belgium
    Jun 21 at 17:21










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451129%2fmonitoring-server-bandwidth%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










See if this will work for you.



This will list the received bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $3'


This will list the sent bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $8'


If you need for other interfaces you can change the name.






share|improve this answer





















  • This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
    – matisa
    Jun 21 at 17:02










  • The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
    – MUY Belgium
    Jun 21 at 17:21














up vote
1
down vote



accepted










See if this will work for you.



This will list the received bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $3'


This will list the sent bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $8'


If you need for other interfaces you can change the name.






share|improve this answer





















  • This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
    – matisa
    Jun 21 at 17:02










  • The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
    – MUY Belgium
    Jun 21 at 17:21












up vote
1
down vote



accepted







up vote
1
down vote



accepted






See if this will work for you.



This will list the received bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $3'


This will list the sent bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $8'


If you need for other interfaces you can change the name.






share|improve this answer













See if this will work for you.



This will list the received bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $3'


This will list the sent bytes for eth0



ifconfig eth0 | grep 'RX b' | sed 's/:/ /g' | awk 'print $8'


If you need for other interfaces you can change the name.







share|improve this answer













share|improve this answer



share|improve this answer











answered Jun 21 at 16:34









K. Kirilov

514




514











  • This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
    – matisa
    Jun 21 at 17:02










  • The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
    – MUY Belgium
    Jun 21 at 17:21
















  • This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
    – matisa
    Jun 21 at 17:02










  • The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
    – MUY Belgium
    Jun 21 at 17:21















This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
– matisa
Jun 21 at 17:02




This is great, but it gives me the total transmitted. Is there a way to get current transmitted on total over the last X time? Or the only way is to get delta over time?
– matisa
Jun 21 at 17:02












The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
– MUY Belgium
Jun 21 at 17:21




The amount of data per second must bae implemented at the level of the visualization program : grafana have a derivative function.
– MUY Belgium
Jun 21 at 17:21












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451129%2fmonitoring-server-bandwidth%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay