# PHP Weathermap v0.97c

#### Copyright © 2005-2013 Howard Jones, `howie@thingy.com`. (Website)

### Error Code Reference

This page is mainly here so that Google can find it, but here's a complete list of all the error codes that Weathermap can produce, and what each one means.

I added this after I noticed a lot of google searches for error messages, that were not hitting a useful page in the manual. This page should be the useful page.

[WMWARN01]

  "Skipping drawing very short link (linkname). Impossible to draw! Try changing WIDTH or ARROWSTYLE? "

  Weathermap draws the arrowheads on links in proportion to the width of the link. If your link is fat, then the arrowhead will be bigger. If you have a very short link (nodes close together), you can get a situation where there is not enough room to draw the arrowheads.

  If you reduce the width of the link, using WIDTH then you might be able to make the arrowheads small enough so that they fit. You can also use ARROWSTYLE to choose a smaller style of arrowhead - ARROWSTYLE 1 1 is the smallest.

  The most common cause of this error is that you have accidentally placed two nodes on top of each other. In that case, move one of the nodes.

  In previous versions (0.8 to 0.82), this would result in the infamous "FELL THROUGH Howie's crappy binary search is wrong after all" error message. The solution is the same - move the nodes, or change the link width

[WMWARN02], [WMWARN04]

  "Angled text doesn't work with non-FreeType fonts "

  The standard fonts used by Weathermap are the ones bundled with the GD graphics library. These fonts (number 1-5 when you select fonts) can only be drawn 'flat', and not at an angle.

  If you are using link comments, or the 'angled' BWSTYLE, then Weathermap needs to be able to drawn text at any angle. To do this, it needs a Truetype font to be used for that part of the map (the bwlabel, or comment), which is drawn using the FreeType library.

  To do this, you need to find a Truetype font, put it in your weathermap folder, and then define a new font in your map config file: `FONTDEFINE 100 Vera 9`

  Then you can use that new font (no. 100) in COMMENTFONT or BWFONT lines.

  You can find some TrueType fonts, and an example.conf that does this in the docs/example folder.

  The reason the default comment font is not a TrueType font is that the FreeType library is an optional part of the GD library, so I can't assume that it will be available.

[WMWARN03]

  "Using a non-existent special font (fontnumber) - falling back to internal GD fonts "

  If you use a font number that doesn't exist by default(e.g. larger than 5), and you haven't got a valid FONTDEFINE line, then you will get this error. Weathermap will use font 5 instead of the font you asked for.

  Most common reason for this error is that the font file could not be found, or could not be loaded. Check the log for another error (WMWARN30 or WMWARN31).

[WMWARN05]

  "ProcessString: key refers to unknown item "

  You used a 'Special Token' string, like {node:this:something}, but the 'something' you used isn't defined for the node or link you specified. This is usually a typographical error.

[WMWARN06]

  "Couldn't open plugin-type Plugin directory (dir). Things will probably go wrong. "

  Parts of Weathermap are loaded from plugins. If these plugin directories don't exist, or are not readable due to file permissions, then the plugins can't be loaded. All data-reading is done by plugins, so without the data-source plugin directory, Weathermap won't do very much.

  Check that lib/datasources, lib/pre and lib/post folders all exist inside your Weathermap folder. Check that they (and their contents) are readable by the user that Weathermap runs as (e.g. your Cacti poller user). On a Unix system, the directories should also be executable by that user, so that the contents of the directory can be seen.

[WMWARN07]

  "ReadData: type name, target: targetstring on config line linenumber was recognised as a valid TARGET by a plugin that is unable to run (pluginname) "

  When the datasource plugins are loaded, each one is given a chance to check if everything it needs is available. If something is missing, that plugin can decline to load. If you have a TARGET line that is aimed at a particular plugin, and that plugin declined to load, you will get this message.

  Examples of this type of problem would be: Using cactihost: TARGETs but with the command-line tool where cactihost: can't load, or using the rrdtool DS from the command-line, without correctly setting a path to rrdtool in the `weathermap` command-line tool.

[WMWARN08]

  "ReadData: type name, target: targetstring[4] on config line linenumber was not recognised as a valid TARGET "

  You have specified a TARGET that none of the datasource plugins recognised. This is usually a typographical error.

[WMWARN09]

  "ColourFromPercent: Attempted to use non-existent scale: scalename for itemname "

  You have added a USESCALE line to a NODE or LINK, but the scale name wasn't defined using SCALE lines first. Define the SCALE, or check your spelling.

[WMWARN10]

  "NODE nodename has a relative position to an unknown node! "

  You have used the relative POSITION for a NODE, but you did it relative to a node that doesn't exist. Probably you have a typographical error/spelling error...

[WMWARN11]

  "There are Circular dependencies in relative POSITION lines for number nodes. "

  You are using relative POSITION for nodes, but somewhere you have a node that is relative to another node that is relative to the first one again - a loop. None of the nodes in the loop can be positioned correctly. Solution: make at least one node in the loop have a normal absolute position.

[WMWARN12]

  "Failed to write map image. No function existed for the image format you requested. "

  You specified a particular format to write the map image with IMAGEFILE, but your php/GD installation doesn't have support for that image format.

  You'll need to either choose a different image format, or recompile/reinstall your php, php-gd and GD libraries to support that image format.

[WMWARN13],[WMWARN15],[WMWARN16]

  "Failed to overwrite existing image file filename - permissions of existing file are wrong? "

  Most likely when using the Cacti plugin. The files in the output/ directory are owned by a different user from the one running weathermap, and so it can't overwrite those files.

  The most common way to get into this situation is by using the "Recalculate Now" button in the Cacti plugin. This creates files that are owned by the user that your webserver runs as. When the poller process comes along a few minutes later, it can no longer write over those files with the new data. Solution: make sure that the directory, and it's contents are owned by the poller user (or 'cactiuser') and don't use the 'Recalculate Now' button any more.

[WMWARN14]

  "Failed to create image file filename - permissions of output directory are wrong? "

  Again, usually in Cacti plugin.

  Weathermap is unable to create files in the directory that the output file should go - this is the plugins/weathermap/output/ directory if you are using the Cacti plugin. Make sure that directory is owned/writable by the user that runs your poller process. This is the same permissions that you would have set on the rra/ directory when installing Cacti itself.

[WMWARN17]

  "Skipping thumbnail creation, since we don't have the necessary function. "

  Your php/php-gd/GD library doesn't include the imagecopyresampled() function, which is required to make the thumbnail images used in the Cacti plugin. To get that function , you'll need to update/recompile/reinstall your php, php-gd and GD libraries.

[WMWARN20]

  "No image (gd) extension is loaded. This is required by weathermap. "

  All the graphics work in Weathermap is done using the gd PHP extension. Your php installation doesn't have this extension, or it is not enabled.

  You'll need to install or enable that extension to use Weathermap.

[WMWARN21]

  "Your GD php module doesn't support PNG format. "

  You specified an ICON or BACKGROUND image in PNG format, and your php-gd extension doesn't support PNG format images.

  You'll need to either choose a different image format, or recompile/reinstall your php, php-gd and GD libraries to support that image format.

[WMWARN22]

  "Your GD php module doesn't support truecolor. "

  Weathermap requires that your GD library and php-gd extension support 24-bit colour (or "TrueColor"). To get that function , you'll need to update/recompile/reinstall your php, php-gd and GD libraries. Most likely, this is the result of an older version of GD.

[WMWARN23]

  "Your GD php module doesn't support thumbnail creation (imagecopyresampled). "

  See WMWARN17

[WMWARN24]

  "Duplicate node name nodename at line linenumber - only the last one defined is used. "

  You have used the same name for two or more NODE lines in your config. This is probably a typo or cut & paste error. One of the two NODEs will not show up in the map.

[WMWARN25]

  "Duplicate link name linkname at line linenumber - only the last one defined is used. "

  You have used the same name for two or more LINK lines in your config. This is probably a typo or cut & paste error. One of the two LINKs will not show up in the map.

[WMWARN26]

  "LINK DEFAULT is not the first LINK. Defaults will not apply to earlier LINKs. "

  You should usually specify your DEFAULT LINK before all your 'real' LINKs. The reason is that when a new LINK is defined, it copies whatever the default settings are at that point in reading down the config file, so you will end up with inconsistent results.

[WMWARN27]

  "NODE DEFAULT is not the first NODE. Defaults will not apply to earlier NODEs. "

  You should usually specify your DEFAULT NODE before all your 'real' NODEs. The reason is that when a new NODE is defined, it copies whatever the default settings are at that point in reading down the config file, so you will end up with inconsistent results.

[WMWARN28]

  "Dropping LINK linkname - it hasn't got 2 NODES! "

  You defined a link where one or both of the nodes in the NODES line don't exist.

  Or you forgot to add a NODES line altogether.

  A link goes between two nodes, so you need to tell weathermap which two nodes, and they need to exist.

[WMWARN30]

  "Failed to load ttf font filename - at config line linenumber"

  You defined a TrueType/FreeType font with FONTDEFINE, but the file doesn't exist, or can't be loaded due to permissions issues.

[WMWARN31]

  "imagettfbbox() is not a defined function. You don't seem to have FreeType compiled into your gd module. "

  You tried to use a TrueType/FreeType font, but your GD library (and/or php-gd extension) don't understand FreeType.

  You'll need to either choose a different font format, or recompile/reinstall your php, php-gd, GD and perhaps freetype2 libraries to support that font format.

[WMWARN32]

  "Failed to load GD font: filename (errorcode) at config line linenumber "

  You defined a .gdf font with FONTDEFINE, but the file doesn't exist, or can't be loaded due to permissions issues.

[WMWARN33]

  "NewColourFromPercent: Clipped number% to 100% for item itemname"

  You are using a regular SCALE with a value that is calculated as a percentage of the MAXVALUE or BANDWIDTH. That calculated value was higher than 100%. You could fix this with one of:

  - Change BANDWIDTH or MAXVALUE to the correct value.
  - Use an absolute SCALE (see USESCALE)
  - Disable the warning by adding 'SET nowarn_clip 1' at the top of the map config file.
[WMWARN34]

  "NewColourFromPercent: Clipped number% to 0% for item itemname"

  You are using a regular SCALE with a value that is calculated as a percentage of the MAXVALUE or BANDWIDTH. That calculated value was below 0%. You could fix this with one of:

  - Use a '-' prefix on the TARGET to make the value positive, if it's always negative, like attentuation readings.
  - Use an absolute SCALE (see USESCALE)
  - Disable the warning by adding 'SET nowarn_clip 1' at the top of the map config file.
[WMWARN35]

  "LINK linkname uses a NODE with no POSITION!"

  Some nodes have no position, because they are used purely as a TEMPLATE for other nodes. You have used one of these for a real link, and as a result, Weathermap can't figure out where to draw the link.

[WMWARN36]

  "Using a non-existent special font (number) - falling back to internal GD fonts"

  You have used a command like COMMENTFONT, TITLEFONT or LABELFONT to change the font to a custom-defined one (number > 5) but there is no FONTDEFINE line for that font number, OR the font could not be loaded. Check back in the logs, for WMWARN30 or WMWARN31.

[WMWARN37]

  "Couldn't open ICON: 'filename' - is it a PNG, JPEG or GIF?"

  The file you specified to use as an ICON does exist, but couldn't be loaded by the GD image library. Check that the file really is an image file.

[WMARN38]

  "ICON 'filename' does not exist, or is not readable. Check path and permissions."

  You specified an ICON, but the file couldn't be opened or couldn't be found at all.

[WMWARN39]

  "line number: TEMPLATE is not first line of object. Some data may be lost."

  The TEMPLATE command works by copying the settings from another node or link over the top of the existing items. If you use some other configuration commands, then use TEMPLATE, the results of those commands may be overwritten by the equivalent settings in the template item.

[WMWARN40]

  "line number: NODE or LINK TEMPLATE 'name' doesn't exist! (if it does exist, check it's defined first)"

  You specified a TEMPLATE, but the node or link doesn't exist. Also, possibly, that the template node is further down in the config file. Best practice is to keep the templates together near the top of the file, along with DEFAULTs.

[WMWARN41]

  "OVERLIBGRAPH is used, but HTMLSTYLE is static. This is probably wrong."

  To generate the 'popup' graphs, the Overlib javascript is required. The default HTML output from Weathermap doesn't include this for historical reasons. If you specify OVERLIBGRAPH, you must also add 'HTMLSTYLE overlib' to the top section of the config file.

[WMWARN42]

  "IN/OUTOVERLIBGRAPH make no sense for a NODE!"

  NODEs don't have a input and output area on the image, so you can't specify separate OVERLIBGRAPHs for each.

[WMWARN43]

  "FindScaleExtent: non-existent SCALE scalename"

  Somehow, Weathermap is trying to draw a legend for a scale that doesn't exist. This is probably a bug - please report.

[WMWARN43]

  "You can't make a contrast with 'none'."

  The 'contrast' option picks black or white depending on what colour the background is. When you set a background of 'none', there is no correct answer, so Weathermap complains. Change 'contrast' to '0 0 0' or '255 255 255' as appropriate.

[WMWARN44]

  "ReadData: NODE/LINK name: You're using asymmetric bandwidth AND half-duplex in the same link. That makes no sense."

  Half-duplex calculates the percentage usage based on (input+output)/max_bandwidth. You have specified different bandwidth in each direction, but also half-duplex. The calculation is not possible.

[WMWARN45]

  "Zero-length link name skipped."

  You have a link from a node to the same node without any VIAs. It isn't possible to draw.

[WMWARN99]

  "something not implemented yet"

  A planned feature has been partially implemented, and you've tried to use it. Wait for the next release.

  Because of the way I write Weathermap, there are sometimes parts of the code that are waiting ready for me to finish writing a new feature. If it's the only thing holding back a release, I'll just disable that feature for now.

[WMEDIT01]

  "The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected."

[WMEDIT02]

  "OLD editor config file format. The format of this file changed in version 0.92 - please check the new editor-config.php-dist and update your editor-config.php file."

[WMIMG01]

  "Image file filename is GIF, but GIF is not supported by your GD library. "

[WMIMG02]

  "Image file filename is JPEG, but JPEG is not supported by your GD library. "

[WMIMG03]

  "Image file filename is PNG, but PNG is not supported by your GD library. "

[WMIMG04]

  "Image file filename wasn't recognised (type=type). Check format is supported by your GD library. "

[WMIMG05]

  "Image file filename is unreadable. Check permissions. "

[WMPOLL01]

  "About to write image file. If this is the last message in your log, increase memory_limit in php.ini"

  PHP has a hard memory limit, to stop runaway scripts from killing your server. Depending on the version of PHP, this can be quite low (8M in older versions). Weathermap uses a lot (relatively) of memory to produce the large image files. If it hits the PHP memory limit, then PHP just kills the script with no warning. Because it log that it is dead (because it is dead), it logs just before the 'risk' happens. If this log message is not the last message in your log file, then nothing is wrong!

  You can disable some messages like this one by changing settings in Cacti. Go to Settings..Misc and set Weathermap Logging to 'Quiet'. If you suddenly get a mystery where Weathermap is only updating some maps, turn it back to 'Chatty' to see what is happening.

[WMPOLL02]

  "Failed to overwrite filename - permissions of existing file are wrong? "

  Weathermap couldn't overwrite an output file. Files in the weathermap/output/ directory should be writable by the Cacti poller user.

[WMPOLL03]

  "Failed to create filename - permissions of output directory are wrong?"

  The weathermap/output/ directory should be writable by the Cacti poller user.

[WMPOLL04]

  "Mapfile filename is not readable or doesn't exist"

  The mapfile could not be opened. That could be because it is not readable by the Cacti poller user, or because the file no longer exists but is still in the database (check the Manage..Weathermaps screen in Cacti).

[WMPOLL05]

  "No activated maps found. "

  There are no maps in the database, or no maps that are enabled at the moment. There is also a scheduling facility, so if no maps are due to be updated according to their schedule, you will get this message. The scheduling feature is not yet in use in 0.97.

[WMPOLL06]

  "Output directory (directory) isn't writable (tried to create 'filename'). No maps created. You probably need to make it writable by the poller process (like you did with the RRA directory)"

  The weathermap/output/ directory should be writable by the Cacti poller user.

[WMPOLL07]

  "Output directory (directory) doesn't exist!. No maps created. You probably need to create that directory, and make it writable by the poller process (like you did with the RRA directory)"

  The weathermap/output/ directory doesn't exist. It is part of the standard zip package, so you probably deleted or renamed it.

[WMPOLL08]

  "Required modules for PHP Weathermap versionnumber were not present. Not running."

  Run 'php check.php' from the command-line, to find out what modules are missing.

[WMFPING01]

  "RRD DS: RRDTool exists but is not executable? "

[WMFPING02]

  "FPing ReadData: Can't find fping executable. Check path at line 19 of WeatherMapDataSource_fping.php"

[WMFPING03]

  "FPing ReadData: No lines read. Bad hostname? (target)"

[WMRRD01]

  "RRD DS: RRDTool exists but is not executable? "

  Somehow you have the right path for rrdtool, but the rrdtool binary is not executable by the user that runs weathermap (e.g. your Cacti poller user). Check permissions on your rrdtool binary.

[WMRRD02]

  "RRD DS: Can't find RRDTOOL. Check line 29 of the 'weathermap' script. RRD-based TARGETs will fail. "

  You are using the command-line `weathermap` tool, but the path near the top of that file (around line 29) is not the correct path to your rrdtool binary. Edit that file and put in the correct path if you need Weathermap to be able to read .rrd files.

[WMRRD03]

  "RRD DS: Can't find RRDTOOL. Check your Cacti config. "

  You have Weathermap integrated into Cacti, but your Cacti settings include an incorrect path to rrdtool. Probably you have a Cacti that doesn't update properly at this stage too, so change the path in Console..Settings..Paths (in Cacti) to point to the right location.

[WMRRD04]

  "RRD ReadData: failed to open pipe to RRDTool: phperrormsg "

  This is probably a Weathermap bug. It was unable to get rrdtool to read a .rrd file even though the file exists. It might be that the user running Weathermap (or the poller) doesn't have execute permission for rrdtool.

[WMRRD06]

  "Target rrdfile doesn't exist. Is it a file? "

  You have given an RRD TARGET which is a directory instead of a file, or something else unusual like that...

[WMRRD07]

  "RRD ReadData: poller_output: dsname is not a valid DS name for rrdfilename - valid names are: dsnames"

  This is explained in this article

[WMRRD08]

  "RRD ReadData: poller_output: filename is not a valid RRD filename within this Cacti install. <path_rra> is pathname"

  The poller_output support works by looking in the Cacti database for a filename that matches your TARGET line. However, Cacti stores the filenames relative to the rra/ directory. Weathermap tries to convert your filename to that format, so it can find it in the database, but it sometimes gets it wrong. The <path_rra> is the path that it is expecting to be on the beginning of absolute paths in your TARGET.

[WMRRD09]

  "Not enough output from RRDTool."

  Weathermap ran rrdtool to read the rrd file for your TARGET, but only got one line of output, probably an error message. Run with debug logging to see what the output was, which should help figuring out what is wrong.

[WMRRD10]

  "Can't use poller_output for rrd-aggregated data - disabling rrd_use_poller_output"

[WMRRD12]

  "RRD ReadData: poller_output - Cacti environment is not right"

[WMDSSTATS01]

  "DSStats ReadData: Failed to find a filename for DS id number"

[WMEXT01]

  "ExternalScript ReadData: Failed to run external script."

[WMEXT02]

  "ExternalScript ReadData: Not enough lines read from external script (number read, 4 expected)"

[WMSNMP01]

  "SNMP for hostname has reached number failures. Skipping."

  The SNMP datasource has a special feature to keep track of how many failures each host has had. This is to avoid the Weathermap process timing out 400 times on a chassis switch that is down. After the first few, it assumes that all requests to that device will fail. See the SNMP DS documentation for information on how to tune this.

[WMTIME01]

  "Time DS Plugin recognised a TARGET, but needs PHP5+ to run."

  The Time DS plugin uses a PHP function that was introduced in PHP 5, and can't run on PHP 4.

[WMTIME02]

  "Time ReadData: Couldn't recognize string as a valid timezone name"

  The timezone string you used was not correct. Probably a typo.