I have search the forum and the docs and the examples, but I can't find info on this.
I use a script command data input method with the following script
Code: Select all
#!/usr/bin/perl
# what server are we polling?
$server=@ARGV[0];
$what=@ARGV[1];
# gather data
@data = `/usr/local/bin/curl -k https://$server/server-status?auto 2> /dev/null`;
if (@data[0] eq "") {
# Uh oh! Webserver might be down!
printf "0";
} else {
# hits
@hits = split(/ /, @data[0]);
chomp(@hits[2]);
printf "hits:@hits[2] ";
# calculate bytes
@bytes = split(/ /, @data[1]);
chomp(@bytes[2]);
printf ("bytes:%5.0f ", ((@bytes[2]+0.5) * 1024));
#calculate concurrent users
@users = split(/ /, @data[7]);
chomp(@users[1]);
printf "users:@users[1] ";
#calculate idle servers
@idle = split(/ /, @data[8]);
chomp(@idle[1]);
printf "idle:@idle[1]\n";
}
I want to create multiple charts with this info, one with hits, one with bytes and one with the combined usage of users and idle.
I create a data template that uses this data input method and has 4 data source items, bytes and hits are DERIVE type, and users and idle are COUNTER type.
I have 3 graphs associated to a host template.
If I create a host of this type and and create all 3 of the graphs, cacti will create 3 times the same data source for this host.
Maybe I missed something here, but I don't know how to tell cacti to use only a single data source for all three graphs...
Can someone help? or do I need to create only multiple data input methods???
[/quote]