Gatherer coring on Solaris *

Ciaran Bryan

02-04-2004 11:26:21


Trying to build netmrg-0.14 on solaris 8 SPARC 64.

Compiles OK but when I run the gatherer the binary core dumps when parsingt the xml config file.

in settings.cpp a call to xmltostring is made but the input field value provided seems to be empty and the snprintf fails and causes a siementation fault. see see code and backtrace below.

Has anyone seen this before on solaris or has anybody build successfully on solaris 8.

I'm running gdb 3.3.2 and libxml 2.4.25
I dont have libxml dev installed, do i need it ?

Help appreciated.

cur = cur->xmlChildrenNode;
while (cur != NULL)
value = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);

val_str = string(xmltostring(value));[/color3bf9b9d684]
if (section == "database")
if (!xmlStrcmp(cur->name, (const xmlChar *) "host"))
set_setting(setDBHost, val_str);

(gdb) bt
#0 0xfecb3200 in strlen () from /usr/lib/
#1 0xfed06270 in _doprnt () from /usr/lib/
#2 0xfed07fb4 in snprintf () from /usr/lib/
#3 0x00038050 in xmltostring(unsigned char const*) (input=0x0)[/color3bf9b9d684]
at settings.cpp95


02-04-2004 14:05:29

My Solaris x86 box is really slow, so I've only been checking that the autoconf and compiling succeeds.

Could you try adding this as the first line of [bcd2a084ae4]xmltostring[/bcd2a084ae4]?
if (input == NULL) return string("");

Let us know if this works. If it doesn't, we'll have to look at a more appropriate alternative than snprintf() for converting the XML strings.

I've started bug#184 for this issue.

Ciaran Bryan

05-04-2004 05:08:46


thats working fine now.

thanks a million.


07-04-2004 15:30:51

Excellent. That will be fixed in the next release.

Are there any other "gotchas" that you have found running NetMRG on Solaris? Our docs don't have much there yet.


Ciaran Bryan

08-04-2004 04:51:19

Couple of things do do with the configure and compilation.

My base install tree is not /usr/local so I've had to specify a few paths etc.

1. NetSNMP must be installed in /usr/local else the configure fails and think this is also true for libxml

2. LDFLAGS must specify runtime -R localtion of libraries as well as -L.

3. Also have to set CXX flags to include libsocket libnsl etc
CXXFLAGS=" -g -lsocket -lnsl -lcrypto";export CXXFLAGS;

4. The cron format you specify to run the gatherer every every 5 mins is not understood by solaris cron, so,
*/5 * * etc doesnt work

Couple Questions
Have you anymore detailed docs/readmes on setting up events/conditions/responses. I'm trying some variable test conditions and with to run a script if a condition exists and the parameters done seem to get passed in correctly.

Also, how do I setup multiple retrieved variables to be displayed on the same graph for a particular monitor, e.g. ifInOctets and ifOutOctets

also, maybe some more explanations on expander placeholders that may be used and where e.g. %dev_type% etc

I dont understand the concepts behind the snmp caching for a device ?


./configure --prefix=/opt/perfmon/netmrg --with-ssl-lib-dir=/usr/local/ssl/lib --with-ssl-include-dir=/usr/local/ssl/include
--with-snmp-lib-dir=/usr/local/lib --with-snmp-include-dir=/usr/local/include --with-xml2-lib-dir=/usr/local/libxml/sparc/lib
--with-xml2-include-dir=/usr/local/libxml/include/libxml2 --with-mysql-lib-dir=/opt/perfmon/mysql/lib --with-mysql-include-dir
=/opt/perfmon/mysql/include 'LDFLAGS= -R /opt/perfmon/mysql/lib -L /opt/perfmon/mysql/lib -R /usr/local/libxml/sparc/lib -L /u
sr/local/libxml/sparc/lib -R /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2 -L /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/
3.3.2 -R /usr/local/lib/sparcv9 -L /usr/local/lib/sparcv9 -R /usr/local/lib -L/usr/local/lib -R /usr/local/ssl/lib -L /usr/lo
cal/ssl/lib -R /opt/perfmon_build/usr/local/lib -L /opt/perfmon_build/usr/local/lib'