Hi Guys
I have the following:
NODE -Availability-x.x.x.x
LABEL {node:this:cacti_availability:%.2f}%
TARGET cactihost:2
USESCALE AVAILABILITY
LABELBGCOLOR none
LABELOUTLINECOLOR none
POSITION 572 417
the problem is that the SCALE AVAILABILITY doesnt work
the "99.7%" for example is always in one color
my scale is not working
SCALE AVAILABILITY 0 96 255 0 0
SCALE AVAILABILITY 0 100 0 255 0
any ideas?
cacti_availability display
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Neither the in or out value for cactihost: is the availability, so you can't use it with a scale to change colours.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
mm, yeah
sorry my error.
i did changes.
and know a have the following:
class WeatherMapDataSource_mysql extends WeatherMapDataSource {
if(preg_match("/^mysqlavailability:([^:]+):([^:]+):([^:]+):([^:]+):([^:]+)$/",$targetstring,$matches))
{
$database_user = $matches[1];
$database_pass = $matches[2];
$database_name = $matches[3];
$database_host = $matches[4];
//$database_table = $matches[4];
$cacti_id = intval($matches[5]);
$SQL = "select availability from host where id=$cacti_id";
if(mysql_connect($database_host,$database_user,$database_pass)) {
if(mysql_select_db($database_name)) {
$result = mysql_query($SQL);
if (!$result) {
warn("dbsample ReadData: Invalid query: " . mysql_error()."\n");
} else {
$row = mysql_fetch_assoc($result);
$resultado = $row['availability'];
$item->add_note("db_resultado",$row['availability']);
a have the correct value, but the scale is my problem
the color is only red, why?
KEYPOS AVAILABILITY 1083 920 AVAILABILITY
SCALE AVAILABILITY 0 96 255 0 0
SCALE AVAILABILITY 96 100 0 255 0
i did changes.
and know a have the following:
class WeatherMapDataSource_mysql extends WeatherMapDataSource {
if(preg_match("/^mysqlavailability:([^:]+):([^:]+):([^:]+):([^:]+):([^:]+)$/",$targetstring,$matches))
{
$database_user = $matches[1];
$database_pass = $matches[2];
$database_name = $matches[3];
$database_host = $matches[4];
//$database_table = $matches[4];
$cacti_id = intval($matches[5]);
$SQL = "select availability from host where id=$cacti_id";
if(mysql_connect($database_host,$database_user,$database_pass)) {
if(mysql_select_db($database_name)) {
$result = mysql_query($SQL);
if (!$result) {
warn("dbsample ReadData: Invalid query: " . mysql_error()."\n");
} else {
$row = mysql_fetch_assoc($result);
$resultado = $row['availability'];
$item->add_note("db_resultado",$row['availability']);
a have the correct value, but the scale is my problem
the color is only red, why?
KEYPOS AVAILABILITY 1083 920 AVAILABILITY
SCALE AVAILABILITY 0 96 255 0 0
SCALE AVAILABILITY 96 100 0 255 0
DRES
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Don't know... that looks about right.
Do you set the MAXVALUE for NODEs in the default node? It's 100 by default, but if you had changed it then the percentage calculation would be wrong...
other than that, try running with DEBUG logging for a poller cycle. You'll see the 'ColourFromPercent' function converting the percentage to a colour, which might give you a clue. You should also look for the ReadData parts, to make sure that your new DS plugin is getting data back to weathermap OK.
I should really improve this a bit so that you don't need to write a new plugin though - the data is already available
Do you set the MAXVALUE for NODEs in the default node? It's 100 by default, but if you had changed it then the percentage calculation would be wrong...
other than that, try running with DEBUG logging for a poller cycle. You'll see the 'ColourFromPercent' function converting the percentage to a colour, which might give you a clue. You should also look for the ReadData parts, to make sure that your new DS plugin is getting data back to weathermap OK.
I should really improve this a bit so that you don't need to write a new plugin though - the data is already available
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Who is online
Users browsing this forum: No registered users and 4 guests