mrtg cpu, mem, swap, tcpopen and oracle connections cfg
Date: August 31, 2007
i am posting a quick mrtg cfg file which will check for free memory, cpu usage, swap, tcp connections and oracle connections.
these were tested with solaris 10, various linux distros and snmp v1.
## specify mrtg workdir ## WorkDir: <work dir> RunAsDaemon: Yes ## interval for mrtg can not be set to less than 5 minutes Interval: 5 EnableIPv6: no ## change sizes of graphs as needed XSize[_]: 500 YSize[_]: 200 ## change colors to whatever Colours[_]: DKBLUE#61A0DF,DKBLUE#0000DD,RED#FF0000,DKRED#AB0000 Target[test.oracle]:`<script dir>/oracle-graph.sh` AbsMax[test.oracle]: 2000 MaxBytes[test.oracle]: 1 Title[test.oracle]: oracle connections - test PageTop[test.oracle]: <H1>oracle connections - test</H1> Unscaled[test.oracle]: ymwd ShortLegend[test.oracle]: . YLegend[test.oracle]: oracle connection count ## reference tables 1 & 2 in the script ## remember mrtg's limit on two data sources Legend1[test.oracle]: connections to table 1 Legend2[test.oracle]: connections to table 2 LegendI[test.oracle]: table 1 LegendO[test.oracle]: table 2 Options[test.oracle]: growright,nopercent,gauge,absolute ################################################################# # oracle-graph.sh script # #!/bin/bash # oracle-graph.sh # # for this script make sure you have password-less ssh set up # # DBSERVER=<oracle server ip/hosname> # ssh $DBSERVER ps -fu oracle | grep -c "table 1" # ssh $DBSERVER ps -fu oracle | grep -c "table 2" ################################################################# ## snmp info ## test@localhost:port ## change test to snmp community name ## change localhost to ip name / hostname ## change port to non standard port if needed, if snmp is on standard port then erase this ## cpu graphs Target[test.cpu]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.1:test@localhost:port AbsMax[test.cpu]: 10000 Factor[test.cpu]: 0.0 MaxBytes[test.cpu]: 5 Unscaled[test.cpu]: dwmy Options[test.cpu]: gauge, absolute, growright, noinfo, nopercent YLegend[test.cpu]: CPU Load YTicsFactor[test.cpu]: 0.01 ShortLegend[test.cpu]: - LegendI[test.cpu]: 1min ave LegendO[test.cpu]: 5min ave Legend1[test.cpu]: 1min ave Legend2[test.cpu]: 5min ave Title[test.cpu]: CPU Load ($HOST) #PageTop[test.cpu]: <H1>CPU Load Average</H1> ## free memory graphs (solaris) Target[test.mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:test@localhost:port PageTop[test.mem]: <H1>Free Memory</H1> Options[test.mem]: nopercent,growright,gauge,noinfo Title[test.mem]: Free Memory MaxBytes[test.mem]: 1000000000000 kMG[test.mem]: k,M,G,T,P,X YLegend[test.mem]: Memory #YTicsFactor[test.mem]: 0.1 ShortLegend[test.mem]: bytes LegendI[test.mem]: Total Free: Legend2[test.mem]: LegendO[test.mem]: Total Free: Legend1[test.mem]: Free memory, not including swap, in bytes ## free memory graphs (linux) Target[test.mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:test@localhost:port + .1.3.6.1.4.1.2021.4.14.0&.1.3.6.1.4.1.2021.4.14.0:test@localhost:port + .1.3.6.1.4.1.2021.4.15.0&.1.3.6.1.4.1.2021.4.15.0:test@localhost:port PageTop[test.mem]: <H1>Free Memory</H1> Options[test.mem]: nopercent,growright,gauge,noinfo Title[test.mem]: Free Memory MaxBytes[test.mem]: 1000000000000 kMG[test.mem]: k,M,G,T,P,X YLegend[test.mem]: Memory #YTicsFactor[test.mem]: 0.1 ShortLegend[test.mem]: bytes LegendI[test.mem]: Total Free: Legend2[test.mem]: LegendO[test.mem]: Total Free: Legend1[test.mem]: Free memory, not including swap, in bytes ## swap graphs Target[test.swap]: .1.3.6.1.4.1.2021.4.4.0&.1.3.6.1.4.1.2021.4.4.0:test@localhost:port PageTop[test.swap]: <H1>Swap Memory</H1> Options[test.swap]: nopercent,growright,gauge,noinfo Title[test.swap]: Free Memory MaxBytes[test.swap]: 10000000000000 kMG[test.swap]: k,M,G,T,P,X YLegend[test.swap]: bytes ShortLegend[test.swap]: bytes LegendI[test.swap]: Free Memory: LegendO[test.swap]: Legend1[test.swap]: Swap memory avail, in bytes ## open tcp connections Target[test.tcpopen]:.1.3.6.1.2.1.6.9.0&.1.3.6.1.2.1.6.9.0:test@localhost:port Options[test.tcpopen]: nopercent,growright,gauge,noinfo Title[test.tcpopen]: Open TCP connections PageTop[test.tcpopen]: <H1>Open TCP connections</H1> MaxBytes[test.tcpopen]: 1000000 YLegend[test.tcpopen]: # of connections ShortLegend[test.tcpopen]: connections LegendI[test.tcpopen]: Connections: LegendO[test.tcpopen]: Legend1[test.tcpopen]: Open TCP connections
any questions – msg me
Leave a Reply