安装 Nagios 的 GD 图形库的最佳方法是什么?

安装 Nagios 的 GD 图形库的最佳方法是什么?

尝试安装 Nagios 3.2.3 时,我运行了其 ./configure 脚本并收到以下错误:

checking for main in -liconv... no
checking for gdImagePng in -lgd (order 1)... no
checking for gdImagePng in -lgd (order 2)... no
checking for gdImagePng in -lgd (order 3)... no
checking for gdImagePng in -lgd (order 4)... no


*** GD, PNG, and/or JPEG libraries could not be located... *********

Boutell's GD library is required to compile the statusmap, trends
and histogram CGIs.  Get it from http://www.boutell.com/gd/, compile
it, and use the --with-gd-lib and --with-gd-inc arguments to specify
the locations of the GD library and include files.

NOTE: In addition to the gd-devel library, you'll also need to make
      sure you have the png-devel and jpeg-devel libraries installed
      on your system.

NOTE: After you install the necessary libraries on your system:
      1. Make sure /etc/ld.so.conf has an entry for the directory in
         which the GD, PNG, and JPEG libraries are installed.
      2. Run 'ldconfig' to update the run-time linker options.
      3. Run 'make clean' in the Nagios distribution to clean out
         any old references to your previous compile.
      4. Rerun the configure script.

NOTE: If you can't get the configure script to recognize the GD libs
      on your system, get over it and move on to other things.  The
      CGIs that use the GD libs are just a small part of the entire
      Nagios package.  Get everything else working first and then
      revisit the problem.  Make sure to check the nagios-users
      mailing list archives for possible solutions to GD library
      problems when you resume your troubleshooting.

********************************************************************

我想要哪个包?libgd2-xpm-dev?libgd2-noxpm-dev?php5-gd?我不想自己做任何图像处理 - 我只想让 Nagios 工作。

答案1

如果你看一下nagios 的网站,您会注意到 Ubuntu 7.10 及更高版本的指南要求您libgd2-xpm-dev使用此命令进行安装:

sudo apt-get install libgd2-xpm-dev

这应该对你有用!当然,你也可以按照 Ubuntu 服务器指南进行操作安装 nagios 包而不是自己构建。

答案2

我使用了如下命令:

sudo apt-get install php5-gd
sudo service apache2 restart

相关内容