<command>
<option>apcupsd_loadgraph</option>
</command>
- <option>("normal"|"log") (height),(width) (gradient
- colour 1) (gradient colour 2) (scale) (-t)</option>
+ <option>(height),(width) (gradient colour 1) (gradient
+ colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>History graph of current load.
<para /></listitem>
<command>
<option>cpugraph</option>
</command>
- <option>(cpuN) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(cpuN) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>CPU usage graph, with optional colours in hex,
minus the #. See $cpu for more info on SMP. Uses a
- logarithmic scale (to see small numbers) when you use "log"
- instead of "normal". Takes the switch '-t' to use a
- temperature gradient, which makes the gradient values
- change depending on the amplitude of a particular graph
- value (try it and see).
+ logarithmic scale (to see small numbers) when you use the
+ -l switch. Takes the switch '-t' to use a temperature
+ gradient, which makes the gradient values change depending
+ on the amplitude of a particular graph value (try it and
+ see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>diskiograph</option>
</command>
- <option>(device) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(device) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Disk IO graph, colours defined in hex, minus the
#. If scale is non-zero, it becomes the scale for the
graph. Uses a logarithmic scale (to see small numbers) when
- you use "log" instead of "normal". Takes the switch '-t' to
- use a temperature gradient, which makes the gradient values
+ you use -l switch. Takes the switch '-t' to use a
+ temperature gradient, which makes the gradient values
change depending on the amplitude of a particular graph
value (try it and see).
<para /></listitem>
<command>
<option>diskiograph_read</option>
</command>
- <option>(device) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(device) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Disk IO graph for reads, colours defined in hex,
minus the #. If scale is non-zero, it becomes the scale for
the graph. Device as in diskio. Uses a logarithmic scale
- (to see small numbers) when you use "log" instead of
- "normal". Takes the switch '-t' to use a temperature
- gradient, which makes the gradient values change depending
- on the amplitude of a particular graph value (try it and
- see).
+ (to see small numbers) when you use -l switch. Takes the
+ switch '-t' to use a temperature gradient, which makes the
+ gradient values change depending on the amplitude of a
+ particular graph value (try it and see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>diskiograph_write</option>
</command>
- <option>(device) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(device) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Disk IO graph for writes, colours defined in hex,
minus the #. If scale is non-zero, it becomes the scale for
the graph. Device as in diskio. Uses a logarithmic scale
- (to see small numbers) when you use "log" instead of
- "normal". Takes the switch '-t' to use a temperature
- gradient, which makes the gradient values change depending
- on the amplitude of a particular graph value (try it and
- see).
+ (to see small numbers) when you use -l switch. Takes the
+ switch '-t' to use a temperature gradient, which makes the
+ gradient values change depending on the amplitude of a
+ particular graph value (try it and see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>downspeedgraph</option>
</command>
- <option>(netdev) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(netdev) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Download speed graph, colours defined in hex,
minus the #. If scale is non-zero, it becomes the scale for
the graph. Uses a logarithmic scale (to see small numbers)
- when you use "log" instead of "normal". Takes the switch
- '-t' to use a temperature gradient, which makes the
- gradient values change depending on the amplitude of a
- particular graph value (try it and see).
+ when you use -l switch. Takes the switch '-t' to use a
+ temperature gradient, which makes the gradient values
+ change depending on the amplitude of a particular graph
+ value (try it and see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>execgraph</option>
</command>
- <option>("normal"|"log") (-t) command</option>
+ <option>(-t) (-l) command</option>
</term>
<listitem>Same as execbar, but graphs values. Uses a
- logaritmic scale when the log option is given (to see small
- numbers). Values still have to be between 0 and 100. The
- size for graphs can be controlled via the
+ logaritmic scale when the log option (-l switch) is given
+ (to see small numbers). Values still have to be between 0
+ and 100. The size for graphs can be controlled via the
default_graph_size config setting. Takes the switch '-t' to
use a temperature gradient, which makes the gradient values
change depending on the amplitude of a particular graph
<command>
<option>execigraph</option>
</command>
- <option>interval ("normal"|"log") (-t) command</option>
+ <option>interval (-t) (-l) command</option>
</term>
<listitem>Same as execgraph, but takes an interval arg and
graphs values.
<command>
<option>loadgraph</option>
</command>
- <option>("normal"|"log") (height),(width) (gradient
- colour 1) (gradient colour 2) (scale) (-t)</option>
+ <option>(height),(width) (gradient colour 1) (gradient
+ colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Load1 average graph, similar to xload, with
optional colours in hex, minus the #. Uses a logarithmic
- scale (to see small numbers) when you use "log" instead of
- "normal". Takes the switch '-t' to use a temperature
- gradient, which makes the gradient values change depending
- on the amplitude of a particular graph value (try it and
- see).
+ scale (to see small numbers) when you use the -l switch.
+ Takes the switch '-t' to use a temperature gradient, which
+ makes the gradient values change depending on the amplitude
+ of a particular graph value (try it and see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>lua_graph</option>
</command>
- <option>function_name (function parameters)
- ("normal"|"log") (height),(width) (gradient colour 1)
- (gradient colour 2) (scale) (-t)</option>
+ <option>function_name (height),(width) (gradient colour
+ 1) (gradient colour 2) (scale) (-t) (-l)</option>
</term>
- <listitem>Executes a Lua function with given parameters and
- draws a graph. Expects result value to be any number, and
- by default will scale to show the full range. See also
- 'lua_load' on how to load scripts. Takes the switch '-t' to
- use a temperature gradient, which makes the gradient values
- change depending on the amplitude of a particular graph
- value (try it and see).
+ <listitem>Executes a Lua function with and draws a graph.
+ Expects result value to be any number, and by default will
+ scale to show the full range. See also 'lua_load' on how to
+ load scripts. Takes the switch '-t' to use a temperature
+ gradient, which makes the gradient values change depending
+ on the amplitude of a particular graph value (try it and
+ see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>memgraph</option>
</command>
- <option>("normal"|"log") (height),(width) (gradient
- colour 1) (gradient colour 2) (scale) (-t)</option>
+ <option>(height),(width) (gradient colour 1) (gradient
+ colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Memory usage graph. Uses a logarithmic scale (to
- see small numbers) when you use "log" instead of "normal".
- Takes the switch '-t' to use a temperature gradient, which
- makes the gradient values change depending on the amplitude
- of a particular graph value (try it and see).
+ see small numbers) when you use the -l switch. Takes the
+ switch '-t' to use a temperature gradient, which makes the
+ gradient values change depending on the amplitude of a
+ particular graph value (try it and see).
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>upspeedgraph</option>
</command>
- <option>(netdev) ("normal"|"log") (height),(width)
- (gradient colour 1) (gradient colour 2) (scale)
- (-t)</option>
+ <option>(netdev) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Upload speed graph, colours defined in hex, minus
the #. If scale is non-zero, it becomes the scale for the
graph. Uses a logarithmic scale (to see small numbers) when
- you use "log" instead of "normal". Takes the switch '-t' to
- use a temperature gradient, which makes the gradient values
+ you use the -l switch. Takes the switch '-t' to use a
+ temperature gradient, which makes the gradient values
change depending on the amplitude of a particular graph
value (try it and see).
<para /></listitem>
unsigned int *first_colour, unsigned int *last_colour,
unsigned int *scale, char *showaslog, char *tempgrad)
{
- const char *nographtype;
- char buf[64];
- buf[0] = 0;
+ char buf[1024];
+ memset(buf, 0, 1024);
/* zero width means all space that is available */
*w = default_graph_width;
*last_colour = 0;
*scale = 0;
*tempgrad = FALSE;
+ *showaslog = FALSE;
if (args) {
- // set showaslog and place the rest of the args in nographtype
- if (strcasecmp(args, LOGGRAPH) == EQUAL) {
- *showaslog = TRUE;
- return NULL;
- } else if (strcasecmp(args, NORMGRAPH) == EQUAL) {
- *showaslog = FALSE;
- return NULL;
- } else if (strncasecmp(args, LOGGRAPH" ", strlen(LOGGRAPH) + 1 ) == EQUAL) {
- *showaslog = TRUE;
- nographtype = &args[strlen(LOGGRAPH) + 1];
- } else if (strncasecmp(args, NORMGRAPH" ", strlen(NORMGRAPH) + 1 ) == EQUAL) {
- *showaslog = FALSE;
- nographtype = &args[strlen(NORMGRAPH) + 1];
- } else {
- *showaslog = FALSE;
- nographtype = args;
- }
if (strstr(args, " "TEMPGRAD)) {
*tempgrad = TRUE;
}
- DBGP("printing graph as %s, other args are: %s", (*showaslog ? "log" : "normal"), nographtype);
+ if (strstr(args, " "LOGGRAPH)) {
+ *showaslog = TRUE;
+ }
+ DBGP("printing graph as %s, other args are: %s", (*showaslog ? "log" : "normal"), args);
//check the rest of the args
- if (sscanf(nographtype, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) {
+ if (sscanf(args, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) {
return NULL;
}
*scale = 0;
- if (sscanf(nographtype, "%d,%d %x %x", h, w, first_colour, last_colour) == 4) {
+ if (sscanf(args, "%d,%d %x %x", h, w, first_colour, last_colour) == 4) {
return NULL;
}
- if (sscanf(nographtype, "%63s %d,%d %x %x %u", buf, h, w, first_colour, last_colour, scale) == 6) {
+ if (sscanf(args, "%1023s %d,%d %x %x %u", buf, h, w, first_colour, last_colour, scale) == 6) {
return strndup(buf, text_buffer_size);
}
*scale = 0;
- if (sscanf(nographtype, "%63s %d,%d %x %x", buf, h, w, first_colour, last_colour) == 5) {
+ if (sscanf(args, "%1023s %d,%d %x %x", buf, h, w, first_colour, last_colour) == 5) {
return strndup(buf, text_buffer_size);
}
buf[0] = '\0';
*h = 25;
*w = 0;
- if (sscanf(nographtype, "%x %x %u", first_colour, last_colour, scale) == 3) {
+ if (sscanf(args, "%x %x %u", first_colour, last_colour, scale) == 3) {
return NULL;
}
*scale = 0;
- if (sscanf(nographtype, "%x %x", first_colour, last_colour) == 2) {
+ if (sscanf(args, "%x %x", first_colour, last_colour) == 2) {
return NULL;
}
- if (sscanf(nographtype, "%63s %x %x %u", buf, first_colour, last_colour, scale) == 4) {
+ if (sscanf(args, "%1023s %x %x %u", buf, first_colour, last_colour, scale) == 4) {
return strndup(buf, text_buffer_size);
}
*scale = 0;
- if (sscanf(nographtype, "%63s %x %x", buf, first_colour, last_colour) == 3) {
+ if (sscanf(args, "%1023s %x %x", buf, first_colour, last_colour) == 3) {
return strndup(buf, text_buffer_size);
}
buf[0] = '\0';
*first_colour = 0;
*last_colour = 0;
- if (sscanf(nographtype, "%d,%d %u", h, w, scale) == 3) {
+ if (sscanf(args, "%d,%d %u", h, w, scale) == 3) {
return NULL;
}
*scale = 0;
- if (sscanf(nographtype, "%d,%d", h, w) == 2) {
+ if (sscanf(args, "%d,%d", h, w) == 2) {
return NULL;
}
- if (sscanf(nographtype, "%63s %d,%d %u", buf, h, w, scale) < 4) {
+ if (sscanf(args, "%1023s %d,%d %u", buf, h, w, scale) < 4) {
*scale = 0;
//TODO: check the return value and throw an error?
- sscanf(nographtype, "%63s %d,%d", buf, h, w);
+ sscanf(args, "%1023s %d,%d", buf, h, w);
}
return strndup(buf, text_buffer_size);