Performance monitoring script in linux





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















I'm trying to create a script that will allow me to monitor CPU Utilization, Memory Utilization, I/O Utilization, and Network Utilization. Currently, I have a script that should run the necessary commands on linux. Hopefully in the end, I'll be able to run this every 15 or so minutes and then use specific information to analyze the data. Below is the script:



#!/bin/sh
########################################################
OUTPUT="ServerPerf`date '+%d%m%y'`.out"
(
echo "=================================================="
echo " Script Starting Time : `date` "
echo "================================================="
echo " Disk I/O Status "
echo "================================================="
echo
iostat
echo
echo "================================================="

echo "##################################################"
echo " NETWORK TCP PARAMETERS STATUS "
echo "##################################################"
echo
echo
netstat -sp tcp
echo
echo " Processes List "
echo
ps -elf
echo
echo " END "
echo
echo "##################################################"
echo "##################################################"
echo " NETWORK CONNECTION PARAMETER "
echo "##################################################"
echo
echo
netstat -an
echo
echo
echo "##################################################"
echo " NETWORK TRAFFIC STATUS ON INTERFACES "
echo "##################################################"
echo
echo
netstat -i
echo
echo
echo "##################################################"
echo " SERVER MEMORY/CPU Utilization Report "
echo "##################################################"
echo
top -d1 -n 5
echo "=================================================="
echo " VMSTAT INFO "
echo "=================================================="
echo
vmstat 5 5
echo
echo "=================================================="
echo " Script Ending Time : `date` "
echo
echo "=================================================="
) >> $OUTPUT


Now, I'd like to take useful data from these files that are created. There are a few categories that the data can be sorted into:




  1. Load Average

  2. CPU Idle Percentage

  3. Kernel Utilization

  4. Memory Utilization

  5. Swapping activity


I'm trying to use these commands to generate these 5 files and seem to be having difficulty.



grep "load avg" /home/test/logs/ServerPerf180610.out | awk '{ print $6 }' | awk -F, '{ print $1 }' > load_avg.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $3 }' | awk -F% '{ print $1 }' > cpu_idle.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $7 }' | awk -F% '{ print $1 }' > cpu_kernel.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $5 }' | awk -FG '{ print $1 }' > memory_util.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $11 }' | awk -FG '{ print $1 }' > swap_util.txt


While these commands run the output files are just empty. Does anyone know why I'm unable to generate these files?



I really appreciate your help.



Thank you,
Aaron



UDPATE: Here is a copy of the output file:
http://www.queencitytech.com/ServerPerfRepo180610.out










share|improve this question

























  • I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

    – MJB
    Jun 18 '10 at 19:39











  • the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

    – Aaron
    Jun 18 '10 at 19:50











  • what about vmstat and dstat?

    – Drakosha
    Jun 18 '10 at 19:52











  • Is there anything in the /home/test/logs/ServerPerf... file?

    – MJB
    Jun 18 '10 at 19:52






  • 1





    I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

    – Pekka 웃
    Jun 18 '10 at 19:55




















3















I'm trying to create a script that will allow me to monitor CPU Utilization, Memory Utilization, I/O Utilization, and Network Utilization. Currently, I have a script that should run the necessary commands on linux. Hopefully in the end, I'll be able to run this every 15 or so minutes and then use specific information to analyze the data. Below is the script:



#!/bin/sh
########################################################
OUTPUT="ServerPerf`date '+%d%m%y'`.out"
(
echo "=================================================="
echo " Script Starting Time : `date` "
echo "================================================="
echo " Disk I/O Status "
echo "================================================="
echo
iostat
echo
echo "================================================="

echo "##################################################"
echo " NETWORK TCP PARAMETERS STATUS "
echo "##################################################"
echo
echo
netstat -sp tcp
echo
echo " Processes List "
echo
ps -elf
echo
echo " END "
echo
echo "##################################################"
echo "##################################################"
echo " NETWORK CONNECTION PARAMETER "
echo "##################################################"
echo
echo
netstat -an
echo
echo
echo "##################################################"
echo " NETWORK TRAFFIC STATUS ON INTERFACES "
echo "##################################################"
echo
echo
netstat -i
echo
echo
echo "##################################################"
echo " SERVER MEMORY/CPU Utilization Report "
echo "##################################################"
echo
top -d1 -n 5
echo "=================================================="
echo " VMSTAT INFO "
echo "=================================================="
echo
vmstat 5 5
echo
echo "=================================================="
echo " Script Ending Time : `date` "
echo
echo "=================================================="
) >> $OUTPUT


Now, I'd like to take useful data from these files that are created. There are a few categories that the data can be sorted into:




  1. Load Average

  2. CPU Idle Percentage

  3. Kernel Utilization

  4. Memory Utilization

  5. Swapping activity


I'm trying to use these commands to generate these 5 files and seem to be having difficulty.



grep "load avg" /home/test/logs/ServerPerf180610.out | awk '{ print $6 }' | awk -F, '{ print $1 }' > load_avg.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $3 }' | awk -F% '{ print $1 }' > cpu_idle.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $7 }' | awk -F% '{ print $1 }' > cpu_kernel.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $5 }' | awk -FG '{ print $1 }' > memory_util.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $11 }' | awk -FG '{ print $1 }' > swap_util.txt


While these commands run the output files are just empty. Does anyone know why I'm unable to generate these files?



I really appreciate your help.



Thank you,
Aaron



UDPATE: Here is a copy of the output file:
http://www.queencitytech.com/ServerPerfRepo180610.out










share|improve this question

























  • I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

    – MJB
    Jun 18 '10 at 19:39











  • the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

    – Aaron
    Jun 18 '10 at 19:50











  • what about vmstat and dstat?

    – Drakosha
    Jun 18 '10 at 19:52











  • Is there anything in the /home/test/logs/ServerPerf... file?

    – MJB
    Jun 18 '10 at 19:52






  • 1





    I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

    – Pekka 웃
    Jun 18 '10 at 19:55
















3












3








3








I'm trying to create a script that will allow me to monitor CPU Utilization, Memory Utilization, I/O Utilization, and Network Utilization. Currently, I have a script that should run the necessary commands on linux. Hopefully in the end, I'll be able to run this every 15 or so minutes and then use specific information to analyze the data. Below is the script:



#!/bin/sh
########################################################
OUTPUT="ServerPerf`date '+%d%m%y'`.out"
(
echo "=================================================="
echo " Script Starting Time : `date` "
echo "================================================="
echo " Disk I/O Status "
echo "================================================="
echo
iostat
echo
echo "================================================="

echo "##################################################"
echo " NETWORK TCP PARAMETERS STATUS "
echo "##################################################"
echo
echo
netstat -sp tcp
echo
echo " Processes List "
echo
ps -elf
echo
echo " END "
echo
echo "##################################################"
echo "##################################################"
echo " NETWORK CONNECTION PARAMETER "
echo "##################################################"
echo
echo
netstat -an
echo
echo
echo "##################################################"
echo " NETWORK TRAFFIC STATUS ON INTERFACES "
echo "##################################################"
echo
echo
netstat -i
echo
echo
echo "##################################################"
echo " SERVER MEMORY/CPU Utilization Report "
echo "##################################################"
echo
top -d1 -n 5
echo "=================================================="
echo " VMSTAT INFO "
echo "=================================================="
echo
vmstat 5 5
echo
echo "=================================================="
echo " Script Ending Time : `date` "
echo
echo "=================================================="
) >> $OUTPUT


Now, I'd like to take useful data from these files that are created. There are a few categories that the data can be sorted into:




  1. Load Average

  2. CPU Idle Percentage

  3. Kernel Utilization

  4. Memory Utilization

  5. Swapping activity


I'm trying to use these commands to generate these 5 files and seem to be having difficulty.



grep "load avg" /home/test/logs/ServerPerf180610.out | awk '{ print $6 }' | awk -F, '{ print $1 }' > load_avg.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $3 }' | awk -F% '{ print $1 }' > cpu_idle.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $7 }' | awk -F% '{ print $1 }' > cpu_kernel.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $5 }' | awk -FG '{ print $1 }' > memory_util.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $11 }' | awk -FG '{ print $1 }' > swap_util.txt


While these commands run the output files are just empty. Does anyone know why I'm unable to generate these files?



I really appreciate your help.



Thank you,
Aaron



UDPATE: Here is a copy of the output file:
http://www.queencitytech.com/ServerPerfRepo180610.out










share|improve this question
















I'm trying to create a script that will allow me to monitor CPU Utilization, Memory Utilization, I/O Utilization, and Network Utilization. Currently, I have a script that should run the necessary commands on linux. Hopefully in the end, I'll be able to run this every 15 or so minutes and then use specific information to analyze the data. Below is the script:



#!/bin/sh
########################################################
OUTPUT="ServerPerf`date '+%d%m%y'`.out"
(
echo "=================================================="
echo " Script Starting Time : `date` "
echo "================================================="
echo " Disk I/O Status "
echo "================================================="
echo
iostat
echo
echo "================================================="

echo "##################################################"
echo " NETWORK TCP PARAMETERS STATUS "
echo "##################################################"
echo
echo
netstat -sp tcp
echo
echo " Processes List "
echo
ps -elf
echo
echo " END "
echo
echo "##################################################"
echo "##################################################"
echo " NETWORK CONNECTION PARAMETER "
echo "##################################################"
echo
echo
netstat -an
echo
echo
echo "##################################################"
echo " NETWORK TRAFFIC STATUS ON INTERFACES "
echo "##################################################"
echo
echo
netstat -i
echo
echo
echo "##################################################"
echo " SERVER MEMORY/CPU Utilization Report "
echo "##################################################"
echo
top -d1 -n 5
echo "=================================================="
echo " VMSTAT INFO "
echo "=================================================="
echo
vmstat 5 5
echo
echo "=================================================="
echo " Script Ending Time : `date` "
echo
echo "=================================================="
) >> $OUTPUT


Now, I'd like to take useful data from these files that are created. There are a few categories that the data can be sorted into:




  1. Load Average

  2. CPU Idle Percentage

  3. Kernel Utilization

  4. Memory Utilization

  5. Swapping activity


I'm trying to use these commands to generate these 5 files and seem to be having difficulty.



grep "load avg" /home/test/logs/ServerPerf180610.out | awk '{ print $6 }' | awk -F, '{ print $1 }' > load_avg.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $3 }' | awk -F% '{ print $1 }' > cpu_idle.txt
grep "CPU states" /home/test/logs/ServerPerf180610.out | awk '{ print $7 }' | awk -F% '{ print $1 }' > cpu_kernel.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $5 }' | awk -FG '{ print $1 }' > memory_util.txt
grep "Memory" /home/test/logs/ServerPerf180610.out | awk '{ print $11 }' | awk -FG '{ print $1 }' > swap_util.txt


While these commands run the output files are just empty. Does anyone know why I'm unable to generate these files?



I really appreciate your help.



Thank you,
Aaron



UDPATE: Here is a copy of the output file:
http://www.queencitytech.com/ServerPerfRepo180610.out







linux performance scripting






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 18 '10 at 19:59







Aaron

















asked Jun 18 '10 at 19:30









AaronAaron

98041634




98041634













  • I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

    – MJB
    Jun 18 '10 at 19:39











  • the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

    – Aaron
    Jun 18 '10 at 19:50











  • what about vmstat and dstat?

    – Drakosha
    Jun 18 '10 at 19:52











  • Is there anything in the /home/test/logs/ServerPerf... file?

    – MJB
    Jun 18 '10 at 19:52






  • 1





    I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

    – Pekka 웃
    Jun 18 '10 at 19:55





















  • I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

    – MJB
    Jun 18 '10 at 19:39











  • the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

    – Aaron
    Jun 18 '10 at 19:50











  • what about vmstat and dstat?

    – Drakosha
    Jun 18 '10 at 19:52











  • Is there anything in the /home/test/logs/ServerPerf... file?

    – MJB
    Jun 18 '10 at 19:52






  • 1





    I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

    – Pekka 웃
    Jun 18 '10 at 19:55



















I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

– MJB
Jun 18 '10 at 19:39





I can't tell for sure because I have a different version. But have you tried just removing the awk portions for troubleshooting? That is, use "grep... > load_avg.txt" instead of the intervening two awk commands?

– MJB
Jun 18 '10 at 19:39













the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

– Aaron
Jun 18 '10 at 19:50





the top command is being used in this script. i've tried removing awk but but doesn't want to output anything either

– Aaron
Jun 18 '10 at 19:50













what about vmstat and dstat?

– Drakosha
Jun 18 '10 at 19:52





what about vmstat and dstat?

– Drakosha
Jun 18 '10 at 19:52













Is there anything in the /home/test/logs/ServerPerf... file?

– MJB
Jun 18 '10 at 19:52





Is there anything in the /home/test/logs/ServerPerf... file?

– MJB
Jun 18 '10 at 19:52




1




1





I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

– Pekka 웃
Jun 18 '10 at 19:55







I can't help with the problem at hand, but are you aware of Cacti? cacti.net (possibly not what you need but to have dropped the name.)

– Pekka 웃
Jun 18 '10 at 19:55














1 Answer
1






active

oldest

votes


















0














Perhaps it is a typo, but the files you are searching and the files you are creating are different.



That is, the OUTPUT=... line says DAY-MONTH-YEAR, but the grep lines say MONTH-DAY-YEAR



EDIT: OK, you posted the output file. There are all kinds of special chars in there, from the top command. Can you add the batch (top -d1 -n1 -b) arg to top to hide that?



ANOTHER EDIT: Your grep commands appear to be case-specific. Is that intentional? The result has no matches for several of your grep filters. Try adding ignore case (grep -i) to the commands. Also, you are searching for "load avg" but the output says "load average" so you should never find it.






share|improve this answer


























  • Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

    – Aaron
    Jun 18 '10 at 19:50











  • that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

    – Aaron
    Jun 18 '10 at 20:14











  • Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

    – MJB
    Jun 18 '10 at 20:19











  • Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

    – MJB
    Jun 18 '10 at 20:24











  • I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

    – Aaron
    Jun 19 '10 at 0:07












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3072542%2fperformance-monitoring-script-in-linux%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Perhaps it is a typo, but the files you are searching and the files you are creating are different.



That is, the OUTPUT=... line says DAY-MONTH-YEAR, but the grep lines say MONTH-DAY-YEAR



EDIT: OK, you posted the output file. There are all kinds of special chars in there, from the top command. Can you add the batch (top -d1 -n1 -b) arg to top to hide that?



ANOTHER EDIT: Your grep commands appear to be case-specific. Is that intentional? The result has no matches for several of your grep filters. Try adding ignore case (grep -i) to the commands. Also, you are searching for "load avg" but the output says "load average" so you should never find it.






share|improve this answer


























  • Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

    – Aaron
    Jun 18 '10 at 19:50











  • that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

    – Aaron
    Jun 18 '10 at 20:14











  • Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

    – MJB
    Jun 18 '10 at 20:19











  • Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

    – MJB
    Jun 18 '10 at 20:24











  • I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

    – Aaron
    Jun 19 '10 at 0:07
















0














Perhaps it is a typo, but the files you are searching and the files you are creating are different.



That is, the OUTPUT=... line says DAY-MONTH-YEAR, but the grep lines say MONTH-DAY-YEAR



EDIT: OK, you posted the output file. There are all kinds of special chars in there, from the top command. Can you add the batch (top -d1 -n1 -b) arg to top to hide that?



ANOTHER EDIT: Your grep commands appear to be case-specific. Is that intentional? The result has no matches for several of your grep filters. Try adding ignore case (grep -i) to the commands. Also, you are searching for "load avg" but the output says "load average" so you should never find it.






share|improve this answer


























  • Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

    – Aaron
    Jun 18 '10 at 19:50











  • that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

    – Aaron
    Jun 18 '10 at 20:14











  • Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

    – MJB
    Jun 18 '10 at 20:19











  • Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

    – MJB
    Jun 18 '10 at 20:24











  • I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

    – Aaron
    Jun 19 '10 at 0:07














0












0








0







Perhaps it is a typo, but the files you are searching and the files you are creating are different.



That is, the OUTPUT=... line says DAY-MONTH-YEAR, but the grep lines say MONTH-DAY-YEAR



EDIT: OK, you posted the output file. There are all kinds of special chars in there, from the top command. Can you add the batch (top -d1 -n1 -b) arg to top to hide that?



ANOTHER EDIT: Your grep commands appear to be case-specific. Is that intentional? The result has no matches for several of your grep filters. Try adding ignore case (grep -i) to the commands. Also, you are searching for "load avg" but the output says "load average" so you should never find it.






share|improve this answer















Perhaps it is a typo, but the files you are searching and the files you are creating are different.



That is, the OUTPUT=... line says DAY-MONTH-YEAR, but the grep lines say MONTH-DAY-YEAR



EDIT: OK, you posted the output file. There are all kinds of special chars in there, from the top command. Can you add the batch (top -d1 -n1 -b) arg to top to hide that?



ANOTHER EDIT: Your grep commands appear to be case-specific. Is that intentional? The result has no matches for several of your grep filters. Try adding ignore case (grep -i) to the commands. Also, you are searching for "load avg" but the output says "load average" so you should never find it.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 18 '10 at 20:09

























answered Jun 18 '10 at 19:41









MJBMJB

6,93622537




6,93622537













  • Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

    – Aaron
    Jun 18 '10 at 19:50











  • that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

    – Aaron
    Jun 18 '10 at 20:14











  • Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

    – MJB
    Jun 18 '10 at 20:19











  • Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

    – MJB
    Jun 18 '10 at 20:24











  • I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

    – Aaron
    Jun 19 '10 at 0:07



















  • Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

    – Aaron
    Jun 18 '10 at 19:50











  • that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

    – Aaron
    Jun 18 '10 at 20:14











  • Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

    – MJB
    Jun 18 '10 at 20:19











  • Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

    – MJB
    Jun 18 '10 at 20:24











  • I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

    – Aaron
    Jun 19 '10 at 0:07

















Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

– Aaron
Jun 18 '10 at 19:50





Actually, I apologize that was a typo on my part. When I ran the command it followed the same as the files.

– Aaron
Jun 18 '10 at 19:50













that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

– Aaron
Jun 18 '10 at 20:14





that makes sense. when i add the ignore case and proper "load average" search all i'm getting in the file is "day" with 4 zeros underneath?

– Aaron
Jun 18 '10 at 20:14













Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

– MJB
Jun 18 '10 at 20:19





Did you also add the batch option to top? I think that top is generating screen control codes to highlight, blink, home, etc, and that might be messing up your output.

– MJB
Jun 18 '10 at 20:19













Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

– MJB
Jun 18 '10 at 20:24





Also, there is no "memory" data. There are sections called Memory, but if you return only those lines you get no data. Also, there are no lines called "CPU States". Where did you get your filters? They just don't exist in the data.

– MJB
Jun 18 '10 at 20:24













I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

– Aaron
Jun 19 '10 at 0:07





I'm not exactly sure about the batch option. I actually have found this on a blog and have been trying to make it work for awhile now. Here is the page (part 2) kumudunix.blogspot.com/2010/01/… It was originally written for Solaris and I modified some commands so they would work on linux. I guess its possible that by changing them I broke the script.

– Aaron
Jun 19 '10 at 0:07




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3072542%2fperformance-monitoring-script-in-linux%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)