FAQ: clock_gettime Error Compiling Xymon Client

"There’s No Such Thing As A Silly Question" -- does the cliche sound familiar? In this part of pimp-my-rig reloaded, technical questions are answered. Mail them to me and I will post the answers here. If you have a better answer, by all means share it with us.

Q. I recently received an email from a previous colleague asking for help regarding errors in compiling XYmon client on a machine running Fedora 13. Yes, the host is a bit old but since the application running is mission critical downtime is not acceptable and putting it under the microscope with a xymon client is a well-thought move.

To give you a better picture of the error, here are a few lines of the xymon client compile, after running "make -s".

(other lines snipped for brevity)
...
timefunc.c: In function âtimespec_textâ:
timefunc.c:140: warning: pointer targets in assignment differ in signedness
timefunc.c:187: warning: pointer targets in passing argument 2 of âaddtobufferâ differ in signedness
/var/tmp/xymon-4.3.7/include/../lib/strfunc.h:16: note: expected âchar *â but argument is of type âunsigned char *â
../lib/xymonclient.a(timefunc-client.o): In function `getntimer':
/var/tmp/xymon-4.3.7/lib/timefunc.c:67: undefined reference to `clock_gettime'
../lib/xymonclient.a(timefunc-client.o): In function `gettimer':
/var/tmp/xymon-4.3.7/lib/timefunc.c:55: undefined reference to `clock_gettime'
collect2: ld returned 1 exit statustfc
make[1]: *** [../client/xymon] Error 1
make: *** [common-client] Error 2

So as you can see, the error is fatal and compilation will not complete successfully. I have been through this error before and made notes of the things done to resolve.

A. Xymon was built to take into account regular expressions on things being monitored -- log files, directory sizes, etc, etc. These files can be monitored by classes and/or pattern matches that can be defined by regular expressions. And for xymon to function properly, the pcre-devel (PERL Compatible Regular Expressions) rpm has to be installed.

So install pcre-devel via yum.

[root@host /var/tmp] yum -y install pcre-devel
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirror.cse.iitk.ac.in
 * updates: mirror.cse.iitk.ac.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pcre-devel.i686 0:7.8-3.fc12 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch         Version             Repository     Size
================================================================================
Installing:
 pcre-devel                i686         7.8-3.fc12          fedora        278 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 278 k
Installed size: 0.9 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 278 k
(1/1): pcre-devel-7.8-3.fc12.i686.rpm                    | 278 kB     00:02     
--------------------------------------------------------------------------------
Total                                           271 kB/s | 278 kB     00:02     

Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : pcre-devel-7.8-3.fc12.i686 [###########################] 1/1

Installed:
  pcre-devel.i686 0:7.8-3.fc12

Complete!

Once pcre-devel is installed, xymon client will compile with a few warnings that can be ignored. Do a "make install" after compile completes. Run the xymon client via "/home/xymon/client/runclient.sh start". The path /home/xymon is the path chosen when running "./configure.client" (or "./configure -client").

This step is optional, but I found that it solves some issues with other versions of Fedora/RedHat based systems. Before running ./configure, define the environment variable LIBRTDEF. Do it with command "export LIBRTDEF=-lrt"

In running xymon client, pcre-devel is more often than not a major dependency. So better install it before doing the compile.

You might also be interested in:

Feedback

We at pimp-my-rig strive to keep on improving, help us reach that goal by leaving comments or constructive criticisms. Don't miss out on our next feature -- subscribe via RSS (What is RSS?).

Share This

0 comments: