Multiple MRTG targets in one
What I have is 2 scripts to get values I'm trying to incorporate them into 1 graph
I can successfully have them in 1 graph by totalling them, as below, but I'm trying to have them separate, like the first value & second value:community, where the first is akin to input and second output (according to manual) but this wont work, anyone ever done something like this before?
(and before you ask, as no doubt someone will chime in with " just use 2 graphs " - no, we are not looking to do that, that is how we see them now, but we want to combine them)
Target[mqueue]: `/usr/sbin/m/outq` + `/usr/sbin/m/inq`
Title[mqueue]: Messages In Mail Queue
PageTop[mqueue]: <H1>Messages In Mail Queue</H1>
Directory[mqueue]: mqueue
MaxBytes[mqueue]: 2000
AbsMax[mqueue]: 100000
YLegend[mqueue]: Messages
ShortLegend[mqueue]: Messages
Legend1[mqueue]: Average Messages
Legend2[mqueue]:
Legend3[mqueue]: Maximum Messages
Legend4[mqueue]:
LegendI[mqueue]:.
LegendO[mqueue]:.
Colours[mqueue]: Red#E41B17, Blue#7BAEFF, Black#000000, Gray#CCCCCC
You can write a small shell script that reads the two values and write them as IN and OUT.
Something like this:
#!/bin/sh
# mqueue.sh
in=`/usr/sbin/inq`
out=`/usr/sbin/m/outq`
uptime="..."
name="..."
echo $in
echo $out
echo $uptime
echo $name
The script is your new target:
Target[mqueue]: `/path/to/mqueue.sh`
...