Graphing snmp data from multiple hosts on same graph

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
jweinraub
Cacti User
Posts: 61
Joined: Fri Apr 13, 2007 9:21 am

Graphing snmp data from multiple hosts on same graph

Post by jweinraub »

I have a few thermal probes in different data centres and I like to plot them all on the same graph.
I don't know how to do so.

I can do so on the command line but I don't know how to add the second data source in the GUI.

Code: Select all

/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Temperature Sensor - Server Closet' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='Degrees Celsius' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/opt/intranet/cacti/rra/temperature_sensor_server_closet_temp_279.rrd":server_closet_temp:AVERAGE \
LINE1:a#000000FF:"Wayne -  "  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:MIN:"Min\:%8.2lf %s"  \
GPRINT:a:MAX:"Max\:%8.2lf %s\n" \
DEF:b="/opt/intranet/cacti/rra/stuart_temperature_sensor_server_closet_temp_284.rrd":server_closet_temp:AVERAGE \
LINE1:b#6DC8FEFF:"Stuart -  "  \
GPRINT:b:LAST:"Current\:%8.2lf %s"  \
GPRINT:b:MIN:"Min\:%8.2lf %s"  \
GPRINT:b:MAX:"Max\:%8.2lf %s\n" 
So, how do I do so within Cacti itself?
Attachments
The graph from the command line
The graph from the command line
foobar.png (27.21 KiB) Viewed 868 times
jweinraub
Cacti User
Posts: 61
Joined: Fri Apr 13, 2007 9:21 am

Re: Graphing snmp data from multiple hosts on same graph

Post by jweinraub »

Anybody? If I can do it from command line, why can I not add a second host rrd from Cacti itself? Am I missing something?
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Graphing snmp data from multiple hosts on same graph

Post by paulgevers »

You can, although I don't know if how I do it would be the best way. I do it in my graph menu and just add the item to the graph from a different source. I guess you should do it via the template.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
jweinraub
Cacti User
Posts: 61
Joined: Fri Apr 13, 2007 9:21 am

Re: Graphing snmp data from multiple hosts on same graph

Post by jweinraub »

But how? I edit graph template, add new data source, but it doesn't imply host itself, so i get invalid graphic error, b/c it doesn't add the def:b for the second host, so it doesn't know what to do with the line.
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Graphing snmp data from multiple hosts on same graph

Post by paulgevers »

Well, this is what I have in one of my graphs:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Elbrus - Web hits (2)' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label='Hits / sec' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/lib/cacti/rra/asac_web_hits.rrd":web_hits:AVERAGE \
DEF:b="/var/lib/cacti/rra/esac_web_hits.rrd":web_hits:AVERAGE \
DEF:c="/var/lib/cacti/rra/gsac_web_hits.rrd":web_hits:AVERAGE \
DEF:d="/var/lib/cacti/rra/ibex_web_hits.rrd":web_hits:AVERAGE \
DEF:e="/var/lib/cacti/rra/lsac_web_hits.rrd":web_hits:AVERAGE \
DEF:f="/var/lib/cacti/rra/maassac_web_hits.rrd":web_hits:AVERAGE \
DEF:g="/var/lib/cacti/rra/nijsac_web_hits.rrd":web_hits:AVERAGE \
DEF:h="/var/lib/cacti/rra/nsac_web_hits.rrd":web_hits:AVERAGE \
DEF:i="/var/lib/cacti/rra/tilsac_web_hits.rrd":web_hits:AVERAGE \
DEF:j="/var/lib/cacti/rra/tsac_web_hits.rrd":web_hits:AVERAGE \
DEF:ba="/var/lib/cacti/rra/usac_web_hits.rrd":web_hits:AVERAGE \
DEF:bb="/var/lib/cacti/rra/yeti_web_hits.rrd":web_hits:AVERAGE \
AREA:a#FFF200FF:"asac"  \
GPRINT:a:LAST:"   cur.%8.2lf %s"  \
GPRINT:a:AVERAGE:"av.%8.2lf %s"  \
AREA:b#FF4105FF:"esac":STACK \
GPRINT:b:LAST:"   cur.%8.2lf %s"  \
GPRINT:b:AVERAGE:"av.%8.2lf %s\n"  \
AREA:c#00BBB4FF:"gsac":STACK \
GPRINT:c:LAST:"   cur.%8.2lf %s"  \
GPRINT:c:AVERAGE:"av.%8.2lf %s"  \
AREA:d#00CF00FF:"ibex":STACK \
GPRINT:d:LAST:"   cur.%8.2lf %s"  \
GPRINT:d:AVERAGE:"av.%8.2lf %s\n"  \
AREA:e#002A97FF:"lsac":STACK \
GPRINT:e:LAST:"   cur.%8.2lf %s"  \
GPRINT:e:AVERAGE:"av.%8.2lf %s"  \
AREA:f#157419FF:"maassac":STACK \
GPRINT:f:LAST:"cur.%8.2lf %s"  \
GPRINT:f:AVERAGE:"av.%8.2lf %s\n"  \
AREA:g#B1441EFF:"nijsac":STACK \
GPRINT:g:LAST:" cur.%8.2lf %s"  \
GPRINT:g:AVERAGE:"av.%8.2lf %s"  \
AREA:h#FF00FFFF:"nsac":STACK \
GPRINT:h:LAST:"   cur.%8.2lf %s"  \
GPRINT:h:AVERAGE:"av.%8.2lf %s\n"  \
AREA:i#750F7DFF:"tilsac":STACK \
GPRINT:i:LAST:" cur.%8.2lf %s"  \
GPRINT:i:AVERAGE:"av.%8.2lf %s"  \
AREA:j#AAABA1FF:"tsac":STACK \
GPRINT:j:LAST:"   cur.%8.2lf %s"  \
GPRINT:j:AVERAGE:"av.%8.2lf %s\n"  \
AREA:ba#C4FD3DFF:"usac":STACK \
GPRINT:ba:LAST:"   cur.%8.2lf %s"  \
GPRINT:ba:AVERAGE:"av.%8.2lf %s"  \
AREA:bb#000000FF:"yeti":STACK \
GPRINT:bb:LAST:"   cur.%8.2lf %s"  \
GPRINT:bb:AVERAGE:"av.%8.2lf %s\n" 

RRDTool Says:

OK
I just added them one by one.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
jweinraub
Cacti User
Posts: 61
Joined: Fri Apr 13, 2007 9:21 am

Re: Graphing snmp data from multiple hosts on same graph

Post by jweinraub »

Right, I did that too to make my own graph using a/b for the two rrds on the command line, but in the cacti front end, how to i give it this information? that came from the debug mode, and i copied pasted into vi, added the new definition to test it, and lo and behold that worked, but i cannot get Cacti to make the two definitions so my cacti graph tree has it like this.
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Graphing snmp data from multiple hosts on same graph

Post by paulgevers »

jweinraub wrote:Right, I did that too to make my own graph using a/b for the two rrds on the command line, but in the cacti front end, how to i give it this information? that came from the debug mode, and i copied pasted into vi, added the new definition to test it, and lo and behold that worked, but i cannot get Cacti to make the two definitions so my cacti graph tree has it like this.
I THINK that I created a custom graph (not via a template) and just added multiple data sources. Unfortunately I can't remember how I did it, but above output is from cacti.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests