1 <?
3 ## the following line is only needed if built as a self-contained
4 ## extension. If you build the rrdtool module as an embedded
5 ## extension, the rrd_* functions will always be available, so you
6 ## do not need the dl() call.
7 dl("rrdtool.so");
9 ##
10 ## demonstration of the rrd_last() command
11 ##
13 $ret = rrd_last("/some/path/some-router-fe2.rrd");
15 if ( $ret != - 1 )
16 {
17 printf("Last update time: %s\n", strftime("%m/%d/%Y %H:%M:%S"), $ret);
18 }
19 else
20 {
21 $err_msg = rrd_error();
22 echo "Error occurred: $err_msg\n";
23 }
26 ?>