Decrease your stress

System users are much happier when they know what to expect. Leaving them in the dark is frustrating and usually counterproductive. If their systems administrator is well informed about the state of the system, users reach a much higher comfort level. By implementing monitoring tools, the systems administrator will have a detailed understanding of the state of the machines and also receive notification of problems before users start pounding on the door or ringing the phone.

In this month's column, I'll look at two tools that help systems administrators know the state of their facilities and notify them when there's a state change: NetSaint and MRTG. They are both free, widely used, and respected, but there are many more sites that would benefit from their use. This column describes the functionality of the tools, requirements for using them, how to implement them, and their use, abuse, and limitations.

About NetSaint

NetSaint Network Monitor ( is a host and network-monitoring software package with configurable alarm mechanisms, including email and pager support. The monitor is written in C on Linux but is relatively easy to port to other platforms and has CGI scripts to integrate NetSaint with a Web server for Web access to status and history information.

NetSaint is currently in Beta release 6 of the 0.0.6 release and is freely available for download. It's released under the GNU General Public License, making it free for use with some limitations.

Extensive documentation, release notes, and FAQ information are available, as is a known bugs list. In fact, the current manual is 175 pages long. The builders of NetSaint obviously believe in full disclosure, which benefits its users. NetSaint requires some effort and study to implement and understand, but the effort is well worth the power it gives you and the money you save by not buying a similar commercial package.

Implementing NetSaint

The NetSaint sidebar shows a complete NetSaint build. Once built and installed, NetSaint runs as a daemon or process on the monitored machines. The most difficult part of implementing NetSaint is determining what you want to monitor, how you want to be alerted, and translating that into configuration files. The installation process actually installs the configuration files and, if you examine the sample configuration files and manuals, you'll find the options and configuration file commands.

There are several configuration files, including commands, in which commands are defined, resource, for storing sensitive information such as passwords, nscgi, which configures NetSaint for monitoring via a Web server, hosts, in which monitored entities are defined, and netsaint, the master configuration file that pulls all of them together.

Those configuration files allow for a great amount of flexibility. You can define groups of hosts, routers, switches, and so on, and give rules for monitoring each of those groups, as well as break out individual entities for special treatment. For alerting, you can define time frames and give separate alert methodologies, depending on the time. For example, you could have email sent to yourself during standard working hours and pages sent to a coworker during nights and weekends. The reverse is also possible, but I don't recommend it. On the whole, the depth of monitoring isn't great.

You can monitor the amount of free hard disk space and CPU use -- the same types of things that standard Solaris commands will do. The advantage, of course, is that NetSaint will run them for you, parse the results, and compare that to thresholds. If the thresholds are exceeded, an alert is triggered. NetSaint offers many additional features, including use of multiple monitoring hosts for redundancy, automatic log file rotation, an event-handler feature that can trigger an activity if an alarm occurs, and an external command interface that allows configuration changes without editing configuration files.

One area where NetSaint goes beyond standard Unix commands is daemon monitoring. NetSaint can connect to a given port and have a discussion with the answering daemon. Obvious uses include ping for network availability, SMTP for email operation, and HTTP for simple Website status determination.

More complex monitoring can be added by writing your own plug-in or using the existing ones. Fortunately, NetSaint development is very active, and there's a wide variety of plug-ins and add-on tools at the NetSaint download page(

Use, abuse, and limitations

Before you spend time implementing NetSaint, reading the manuals, and trying to understand its use, visit the live demo running on the NetSaint Website. It gives a very good feel for how NetSaint works, how it can be used, and what types of activities it can perform for you. That free tool has some serious power and can keep you in close touch with all the systems that are under your control.

NetSaint isn't a capacity-planning tool, and it does not replace programs such as BMC's Best-1. While it does trend tracking, it simply records state changes rather than performance characteristics. It'll show how often a disk space alarm triggered over the past month, but not the actual disk space use over the past month, limiting the feasibility of using NetSaint instead of commercial monitoring tools such as BMC Patrol and CA Unicenter. However, if good, accurate, flexible monitoring is your primary need, NetSaint should be at the top of your evaluation list.

About MRTG

The Multi-Router Traffic Grapher (MRTG) can monitor and graph your network links using Simple Network Management Protocol (SNMP) information from network devices to acquire and plot the information. The output is in the form of HTML code and GIF images, and it can be used for live, continuous monitoring of network traffic. Like NetSaint, it's written to be portable, in C and Perl, and it runs on Unix platforms as well as on NT. Also like NetSaint, it's widely used by administrators who need to know about problems before they happen or at least when they are happening.

MRTG is available for free under the GNU license. Check out the MRTG main site for detailed feature and download information.

For a preview of the power of MRTG, you can check out an example. It doesn't appear to be a live demonstration, but it shows the type of output that MRTG can generate.

Implementing MRTG

Fortunately for the free source community, MRTG uses three other free source libraries to implement its features. Unfortunately for users, you'll have to download and build those other libraries before you can build and use MRTG, and you'll need recent versions of GCC and PERL installed. Luckily, the versions that come with Solaris 8 appear to be recent enough. (See Resources for links to the three libraries.)

Check out the MRTG sidebar for an example of a full build of all the tools.

Use, abuse, and limitations

MRTG is very straightforward. Point

<font face="Courier">cgfmaker</font>
at a SNMP-enabled network device, and it grabs the information from the device, creating a configuration file for MRTG. Config files can also be crafted by hand for more complex needs. The configuration file is then read by MRTG, which reads information from the targets, creates a graph of it, and includes many options for time ranges, intervals, interfaces, ports, and so on. It's unlikely that MRTG will replace HP OpenView anytime soon but, for a free network capture traffic and display tool, it can't be beat.

Danger, Will Robinson

Thanks to David Strom for the following Solaris issue:

Oh, here's a FYI: do NOT use "sys-unconfig" on a Solaris 8 system -- it is badly broken and will really hose up the system info, and there's no fix yet, just a partial patch. What a bad thing to break in a new OS release!

Here's another viewer note about useful IPSEC hands-on experience:

Hi Peter,

Just finished reading your most delightful article in this month's Unix Insider (those Aironet cards sound very cool; not a lot seems to be happening here in Australia, unfortunately). I notice that you were concerned about the lack of information on making Windows 2000 IPSEC talk to Solaris 8 IPSEC. You may find the following useful as we at Centrelink are just going through that exercise.

All the best, David L. Garrard

Finally, there's a useful Solaris-oriented search site available: It's full of recent news, and it provides a Solaris-specific search engine that (it claims) has access to over 2,000 prescreened Solaris-specific sites. I find it hard to believe that there are 2,000 such sites, but the search seems very effective and the content useful. Worth checking out...

Thanks to Jesse St. Laurent for input to this column.



<font face="Courier">
# #comment - download the compressed tar file, uncompress it, and untar it<br>
# #comment - Make sure that /usr/ccs/bin/ is in your search path<br>
# cd /export/home/pbg/netsaint-0.0.6b6<br>
# ls<br>
Changelog        cgi              eventhandlers<br>
INSTALL  functions<br>
LICENSE          common      subst<br>      configure        html   <br>
UPGRADING        contrib          install-sh       utils<br>
base     xdata<br>
# ./configure --prefix=/opt/netsaint <br>
loading cache ./config.cache<br>
checking for a BSD compatible install... (cached) /opt/sfw/bin/ginstall -c<br>
Init script directory:  /etc/init.d<br>
checking for gcc... (cached) gcc<br>
checking whether the C compiler (gcc  ) works... yes<br>
checking whether the C compiler (gcc  ) is a cross-compiler... no<br>
checking whether we are using GNU C... (cached) yes<br>
checking whether gcc accepts -g... (cached) yes<br>
checking whether make sets ${MAKE}... (cached) no<br>
checking for gdImagePng in -lgd (order 1)... (cached) no<br>
checking for gdImagePng in -lgd (order 2)... (cached) no<br>
checking for gdImagePng in -lgd (order 3)... (cached) no<br>
*** GD library could not be located... *****************************<br>
Boutell's GD library is required to compile the statusmap and trends<br>
CGIs.  Get it from, compile it,<br>
and use the --with-gd-lib and --with-gd-inc arguments to specify the<br>
locations of the GD library and include files.<br>
Note: RedHat Linux users can download the 'gd' and 'gd-devel' RPMs<br>
from (try installing<br>
version 1.8.1-2 or newer if you can).<br>
checking how to run the C preprocessor... (cached) gcc -E<br>
checking for ANSI C header files... (cached) yes<br>
checking whether time.h and sys/time.h may both be included... (cached) yes<br>
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes<br>
checking for errno.h... (cached) yes<br>
checking for fcntl.h... (cached) yes<br>
checking for getopt.h... (cached) no<br>
checking for grp.h... (cached) yes<br>
checking for limits.h... (cached) yes<br>
checking for math.h... (cached) yes<br>
checking for pwd.h... (cached) yes<br>
checking for signal.h... (cached) yes<br>
checking for strings.h... (cached) yes<br>
checking for string.h... (cached) yes<br>
checking for syslog.h... (cached) yes<br>
checking for unistd.h... (cached) yes<br>
checking for uio.h... (cached) no<br>
checking for sys/types.h... (cached) yes<br>
checking for sys/time.h... (cached) yes<br>
checking for sys/resource.h... (cached) yes<br>
checking for sys/wait.h... (cached) yes<br>
checking for sys/stat.h... (cached) yes<br>
checking for sys/ipc.h... (cached) yes<br>
checking for sys/msg.h... (cached) yes<br>
checking for working const... (cached) yes<br>
checking whether struct tm is in sys/time.h or time.h... (cached) time.h<br>
checking for tm_zone in struct tm... (cached) no<br>
checking for tzname... (cached) yes<br>
checking for mode_t... (cached) yes<br>
checking for pid_t... (cached) yes<br>
checking for size_t... (cached) yes<br>
checking return type of signal handlers... (cached) void<br>
checking for uid_t in sys/types.h... (cached) yes<br>
checking type of array argument to getgroups... (cached) gid_t<br>
checking for strdup... (cached) yes<br>
checking for strstr... (cached) yes<br>
checking for strtoul... (cached) yes<br>
checking for initgroups... (cached) yes<br>
checking for type of socket size... int<br>
checking for perl... (cached) /usr/bin/perl<br>
creating ./config.status<br>
creating Makefile<br>
creating subst<br>
creating base/Makefile<br>
creating common/Makefile<br>
creating cgi/Makefile<br>
creating html/Makefile<br>
creating xdata/Makefile<br>
creating init-script<br>
creating daemon-init<br>
creating html/index.html<br>
creating html/side.html<br>
creating common/config.h<br>
common/config.h is unchanged<br>
creating base/netsaint.h<br>
base/netsaint.h is unchanged<br>
creating cgi/cgiutils.h<br>
cgi/cgiutils.h is unchanged<br>
# make all<br>
cd ./base; make ; cd ..<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  checks.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  config.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  commands.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  logging.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  notifications.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  sehandlers.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  utils.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  -c  sretention.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  netsaint.c checks.o config.o commands.o<br>
logging.o notifications.o sehandlers.o utils.o sretention.o <br>
../xdata/xrddefault.c ../common/comments.c ../xdata/xcddefault.c <br>
../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
../xdata/xsddefault.c - lm -o netsaint<br>
cd ./cgi; make ; cd ..<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  getcgi.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  cgiutils.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  auth.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  popen.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  cmd.c  getcgi.o cgiutils.o auth.o popen.o<br>
../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c ../xdata/xsd<br>
default.c ../common/comments.c ../xdata/xcddefault.c -o cmd.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  config.c  getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
default.c -o config.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  edata.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  extinfo.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
default.c ../common/comments.c ../xdata/xcddefault.c edata.o <br>
../xdata/xeddefault.c -o extinfo.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -c  lifo.c<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  history.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
../xdata/xsddefault.c lifo.o -o history.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  notifications.c getcgi.o cgiutils.o auth.o<br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c<br> ../xdata/xsddefault.c lifo.o -o notifications.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  outages.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
../xdata/xsddefault.c ../common/comments.c ../xdata/xcddefault.c -o <br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  showlog.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c<br>
../xdata/xsddefault.c lifo.o -o showlog.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  status.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
../xdata/xsddefault.c ../common/comments.c ../xdata/xcddefault.c edata.o <br>
../xdata/xeddefault.c -o status.cgi<br>
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  statuswrl.c getcgi.o cgiutils.o auth.o <br>
popen.o ../common/objects.c ../xdata/xoddefault.c ../common/statusdata.c <br>
../xdata/xsddefault.c -lm edata.o ../xdata/xeddefault.c -o statuswrl.cgi<br>
cd ./html; make ; cd ..<br>
# #comment -  create "netsaint" user in /etc/passwd and "netsaint" group in <br>
# make install<br>
cd ./base; make install ; cd ..<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d /opt/netsaint/bin<br>

/opt/sfw/bin/ginstall -c -m 774 -o netsaint -g netsaint netsaint<br>
cd ./cgi; make install ; cd ..<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d /opt/netsaint/sbin<br>
for file in *.cgi; \<br>
do /opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint $file<br> /opt/netsaint/sbin; done<br>
cd ./html; make install ; cd ..<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/stylesheets<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/docs/images<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/docs/developer<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/docs/developer/images<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/images<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/share/images/logos<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint robots.txt<br> /opt/netsaint/share<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint docs/robots.txt<br> /opt/netsaint/share/docs<br>
for file in *.html; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share; done<br>
for file in media/*.wav; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/media; done<br>
for file in stylesheets/*.css; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/stylesheets; done<br>
for file in docs/*.html; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/docs; done<br>
for file in docs/developer/*.html; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/docs/developer; done<br>
for file in docs/developer/images/*; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/docs/developer/images; done<br>
for file in docs/images/*; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/docs/images; done<br>
for file in images/*.gif;<br> 
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/images; done<br>
for file in images/*.png; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/images; done<br>
for file in images/logos/*; \<br>
do /opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint $file<br> /opt/netsaint/share/images/logos; done<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d /opt/netsaint/var<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d<br> /opt/netsaint/var/archives<br>
# ls<br>
Changelog  eventhandlers    nscgi.cfg<br>
INSTALL          common           functions<br>
LICENSE          config.cache     hosts.cfg        resource.cfg<br>
Makefile         config.log<br>      config.status    html             subst<br>
README           configure        init-script<br>
UPGRADING   test.cfg<br>
base             contrib          install-sh<br>
cgi              daemon-init      netsaint.cfg     utils<br>
commands.cfg  xdata<br>
# make install-config<br>
/opt/sfw/bin/ginstall -c -m 775 -o netsaint -g netsaint -d /opt/netsaint/etc<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint netsaint.cfg<br> /opt/netsaint/etc<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint hosts.cfg<br> /opt/netsaint/etc<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint commands.cfg<br> /opt/netsaint/etc<br>
/opt/sfw/bin/ginstall -c -m 664 -o netsaint -g netsaint nscgi.cfg<br> /opt/netsaint/etc<br>
/opt/sfw/bin/ginstall -c -m 660 -o netsaint -g netsaint resource.cfg<br> /opt/netsaint/etc<br>
# make install-init<br>
/opt/sfw/bin/ginstall -c -m 774 -o root -g root init-script<br> /etc/init.d/netsaint<br>
# ls /opt/netsaint<br>     
bin    etc    sbin   share  var<br>
# ls -l /opt/netsaint/bin<br>
total 1488<br>
-rwxrwxr--   1 netsaint netsaint  751580 Oct  9 22:59 netsaint<br>
MRTG sidebar
<font face="Courier"
# cd /export/home/pbg<br>
# gunzip mrtg.tar.gz<br>
# tar xf mrtg*<br>
# gunzip gd*<br>
# tar xf gd*<br>
# gunzip libp*<br>
# tar xf libp*<br>
# ls<br>
gd-1.8.3  <br>
libpng-1.0.8 <br>
mrtg-2.9.2      <br>               
# cd gd-1.8.3<br>
# make<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_gd.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_gd2.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_io.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_io_dp.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_io_file.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_ss.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_io_ss.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_png.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_jpeg.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdxpm.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdfontt.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdfonts.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdfontmb.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdfontl.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdfontg.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdtables.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdttf.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdcache.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdkanji.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  wbmp.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd_wbmp.c<br>
rm -f libgd.a<br>
ar rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \<br>
     gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \<br>
     gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \<br>
     gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o<br>
ranlib libgd.a<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  pngtogd.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> pngtogd.o -o pngtogd     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br> 
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  pngtogd2.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> pngtogd2.o -o pngtogd2     -L. -L/usr/local/lib -L/usr/lib/X11<br> -L/usr/X11R6/lib -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdtopng.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gdtopng.o -o gdtopng     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd2topng.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gd2topng.o -o gd2topng     -L. -L/usr/local/lib -L/usr/lib/X11<br> -L/usr/X11R6/lib -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd2copypal.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gd2copypal.o -o gd2copypal     -L. -L/usr/local/lib -L/usr/lib/X11<br> -L/usr/X11R6/lib -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdparttopng.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gdparttopng.o -o gdparttopng     -L. -L/usr/local/lib -L/usr/lib/X11<br> -L/usr/X11R6/lib -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  webpng.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> webpng.o -o webpng     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdtest.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gdtest.o -o gdtest     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gddemo.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gddemo.o -o gddemo     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gd2time.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gd2time.o -o gd2time     -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib<br> -lm -lgd -lpng -lz<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O<br>  -c  gdtestttf.c<br>
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11<br> gdtestttf.o -o gdtestttf     -L. -L/usr/local/lib -L/usr/lib/X11<br> -L/usr/X11R6/lib -lm -lgd -lpng -lz<br>
# ls -l /usr/local
lrwxrwxrwx   1 root     other         10 Aug  3 21:50 /usr/local -> /opt/local<br>
# mkdir /opt/local/lib<br>
# mkdir /opt/local/include<br>
# make install<br>
sh ./install-item 644 libgd.a /usr/local/lib/libgd.a<br>
sh ./install-item 755 pngtogd /usr/local/bin/pngtogd<br>
sh ./install-item 755 pngtogd2 /usr/local/bin/pngtogd2<br>
sh ./install-item 755 gdtopng /usr/local/bin/gdtopng<br>
sh ./install-item 755 gd2topng /usr/local/bin/gd2topng<br>
sh ./install-item 755 gd2copypal /usr/local/bin/gd2copypal<br>
sh ./install-item 755 gdparttopng /usr/local/bin/gdparttopng<br>
sh ./install-item 755 webpng /usr/local/bin/webpng<br>
sh ./install-item 755 bdftogd /usr/local/bin/bdftogd<br>
sh ./install-item 644 gd.h /usr/local/include/gd.h<br>
sh ./install-item 644 gdcache.h /usr/local/include/gdcache.h<br>
sh ./install-item 644 gd_io.h /usr/local/include/gd_io.h<br>
sh ./install-item 644 gdfontg.h /usr/local/include/gdfontg.h<br>
sh ./install-item 644 gdfontl.h /usr/local/include/gdfontl.h<br>
sh ./install-item 644 gdfontmb.h /usr/local/include/gdfontmb.h<br>
sh ./install-item 644 gdfonts.h /usr/local/include/gdfonts.h<br>
sh ./install-item 644 gdfontt.h /usr/local/include/gdfontt.h<br>
# cd ../libpng-1.0.8<br>
# ls<br>
ANNOUNCE     configure    png.c        pngget.c     pngset.c     pngwutil.c<br>
CHANGES      contrib      png.h        pngmem.c     pngtest.c    scripts<br>
INSTALL      example.c    pngasmrd.h   pngnow.png   pngtest.png  wince<br>
KNOWNBUG     libpng.3     pngbar.jpg   pngpread.c   pngtrans.c<br>
LICENSE      libpng.txt   pngbar.png   pngread.c    pngvcrd.c<br>
README       libpngpf.3   pngconf.h    pngrio.c     pngwio.c<br>
TODO         msvc         pngerror.c   pngrtran.c   pngwrite.c<br>
Y2KINFO      png.5        pnggccrd.c   pngrutil.c   pngwtran.c<br>
# ./configure<br>
  There is no "configure" script for Libpng-1.0.8.  Instead, please<br>
  copy the appropriate makefile for your system from the "scripts"<br>
  directory.  Read the INSTALL file for more details.<br>
# ls scripts<br>
SCOPTIONS.ppc      makefile.cygwin    makefile.mips      makefile.vcawin32<br>
descrip.mms        makefile.dec       makefile.msc       makefile.vcwin32<br>
libpng.icc         makefile.dj2       makefile.os2       makefile.watcom<br>
makefile.acorn     makefile.gcc       makefile.sco<br>
makefile.amiga     makefile.gcmmx     makefile.sggcc     pngdef.pas<br>
makefile.atari     makefile.hpux      makefile.sgi       pngos2.def<br>
makefile.bc32      makefile.ibmc      makefile.solaris   smakefile.ppc<br>
makefile.bd32     makefile.std<br>
makefile.beos      makefile.knr       makefile.sunos<br>
makefile.bor       makefile.linux     makefile.tc3<br>
# cp scripts/makefile.solaris Makefile<br>
# make<br>
gcc -I/usr/local/include -Wall -O3  -c  png.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngset.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngget.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngrutil.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngtrans.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngwutil.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngread.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngrio.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngwio.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngwrite.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngrtran.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngwtran.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngmem.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngerror.c<br>
gcc -I/usr/local/include -Wall -O3  -c  pngpread.c<br>
ar rc libpng.a png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o<br>  pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o  pngwtran.o pngmem.o <br>pngerror.o pngpread.o<br>
echo libpng.a<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o png.pic.o png.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngset.pic.o pngset.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngget.pic.o pngget.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngrutil.pic.o pngrutil.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngtrans.pic.o pngtrans.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngwutil.pic.o pngwutil.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngread.pic.o pngread.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngrio.pic.o pngrio.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngwio.pic.o pngwio.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngwrite.pic.o pngwrite.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngrtran.pic.o pngrtran.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngwtran.pic.o pngwtran.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngmem.pic.o pngmem.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngerror.pic.o pngerror.c<br>
gcc -c -I/usr/local/include -Wall -O3 -fPIC -o pngpread.pic.o pngpread.c<br>
ld -G -L/usr/local/lib -R/usr/local/lib -h \<br>
 -o png.pic.o pngset.pic.o pngget.pic.o pngrutil.pic.o<br>
pngtrans.pic.o pngwutil.pic.o  pngread.pic.o pngrio.pic.o pngwio.pic.o<br> pngwrite.pic.o pngrtran.pic.o  pngwtran.pic.o pngmem.pic.o pngerror.pic.o<br> pngpread.pic.o -lz<br>
ln -f -s<br>
ln -f -s<br>
gcc -I/usr/local/include -Wall -O3  -c  pngtest.c<br>
gcc -o pngtest -I/usr/local/include -Wall -O3 pngtest.o -L. -R.<br> -L/usr/local/lib -R/usr/local/lib -lpng -lz -lm<br>
# make install<br>
mkdir: Failed to make directory "/usr/local/include"; File exists<br>
mkdir: Failed to make directory "/usr/local/lib"; File exists<br>
*** Error code 2 (ignored)<br>
cp png.h pngconf.h /usr/local/include<br>
chmod 644 /usr/local/include/png.h /usr/local/include/pngconf.h<br>
cp libpng.a /usr/local/lib<br>
chmod 755 /usr/local/lib/<br>
(cd /usr/local/lib; ln -f -s; \<br>
 ln -f -s<br>
# cd ../mrtg-2.9.2<br>
# ls<br>
ANNOUNCE       MANIFEST       bin            doc            mkinstalldirs<br>
CHANGES    configure      images         src<br>
COPYING        README   install-sh     translate<br>
COPYRIGHT      THANKS         contrib        lib<br>
# #comment - make sure that /opt/local/lib is in your LD_LIBRARY_PATH<br>
# ./configure<br>
loading cache ./config.cache<br>
checking for gcc... gcc<br>
checking whether the C compiler (gcc  ) works... yes<br>
checking whether the C compiler (gcc  ) is a cross-compiler... no<br>
checking whether we are using GNU C... yes<br>
checking whether gcc accepts -g... yes<br>
checking how to run the C preprocessor... gcc -E<br>
checking whether make sets ${MAKE}... yes<br>
checking for a BSD compatible install... /opt/sfw/bin/ginstall -c<br>
checking for perl... /usr/bin/perl<br>
checking for groff... no<br>
checking for nroff... /usr/bin/nroff<br>
checking for acos in -lm... yes<br>
checking for gdImageGif in -lgd... no<br>
checking for gdImagePng in -lgd... yes<br>
checking the weather... (cached) its fine<br>
updating cache ./config.cache<br>
creating ./config.status<br>
creating Makefile<br>
ordering CD from .<br>
 just kidding ;-)<br>
Config is DONE!<br>
Type 'make' to compile the software<br>
       ... that wishlist mentioned above does really exist. So if<br>
you feel like showing your appreciation for MRTG, this is the<br>
place to go. I just love CDs and DVDs<br>
                            -- Tobi Oetiker <> <br>
# make<br>
LD_RUN_PATH= gcc -g -O2 -DGFORM_GD=gdImagePng src/rateup.c -lgd -lm -lpng -lz<br>
-lm -o bin/rateup<br>
src/rateup.c:60: gd.h: No such file or directory<br>
src/rateup.c:61: gdfonts.h: No such file or directory<br>
*** Error code 1<br>
make: Fatal error: Command failed for target `bin/rateup'<br>
# #comment - quick hack of the Makefile to search /opt/local/include <br>
# #commend - for include files and /opt/local/lib for libraries<br>
# make<br>
LD_RUN_PATH=/usr/local/lib gcc -g -O2 -DGFORM_GD=gdImagePng<br> -I/opt/local/include src/rateup.c -lgd -lm -lpng -lz -lm -o bin/rateup<br>
/usr/bin/perl -0777 -pi -e 's@^#!\s*/\S*perl@#! /usr/bin/perl@' bin/cfgmaker<br> bin/indexmaker bin/mrtg<br>
/usr/bin/perl -0777 -pi -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' bin/mrtg<br> bin/indexmaker<br>
# make install<br>
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/bin<br>
mkdir /usr/local/mrtg-2<br>
mkdir /usr/local/mrtg-2/bin<br>
for x in bin/mrtg bin/cfgmaker bin/indexmaker bin/rateup; do \<br>
  /opt/sfw/bin/ginstall -c -m 755 $x /usr/local/mrtg-2/bin; done<br>
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/lib/mrtg2/Pod<br>
mkdir /usr/local/mrtg-2/lib<br>
mkdir /usr/local/mrtg-2/lib/mrtg2<br>
mkdir /usr/local/mrtg-2/lib/mrtg2/Pod<br>
for x in lib/mrtg2/*.pm; do \<br>
  /opt/sfw/bin/ginstall -c -m 644 $x /usr/local/mrtg-2/lib/mrtg2; done<br>
for x in lib/mrtg2/Pod/*.pm; do \<br>
  /opt/sfw/bin/ginstall -c -m 644 $x /usr/local/mrtg-2/lib/mrtg2/Pod; done<br>
for x in images/*.gif images/*.png; do \<br>
  /opt/sfw/bin/ginstall -c -m 644 $x /usr/local/mrtg-2/lib/mrtg2; done<br>
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/doc/mrtg2<br>
mkdir /usr/local/mrtg-2/doc<br>
mkdir /usr/local/mrtg-2/doc/mrtg2<br>
for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.pod doc/*.html<br> doc/*.wml doc/*.txt doc/*.png; do \<br>
  /opt/sfw/bin/ginstall -c -m 644 $x /usr/local/mrtg-2/doc/mrtg2; done<br>
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/man/man1<br>
mkdir /usr/local/mrtg-2/man<br>
mkdir /usr/local/mrtg-2/man/man1<br>
for x in doc/*.1; do \<br>
  /opt/sfw/bin/ginstall -c -m 644 $x /usr/local/mrtg-2/man/man1; done<br>
# cd /opt/local<br>
# ls<br>
bin      include  lib      mrtg-2   vnc<br>
# cd mrtg-2<br>
# ls<br>
bin  doc  lib  man<br>
# cd bin<br>
# ls<br>
cfgmaker    indexmaker  mrtg        rateup<br>
From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies