Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - ArtKZ

#1
Уважаемые разработчики!

По прошествии нескольких лет опять испытываю проблемы со сборкой NetXMS 2.0.5 на Solaris 11.3 SPARC. Проблемы, аналогичные описанным здесь https://www.netxms.org/forum/oe-oo/oem-o-oko-1-2-8-a-solaris-10-113-sparc/, только теперь не собирается как с поддержкой Unicode, так и без.

Сборка без поддержки Unicode:

root@xms:~/NetXMS/netxms-2.0.5# ./configure --with-server --prefix=/opt/netxms --with-pgsql=/opt/postgres/9.5-pgdg --with-agent --with-openssl --with-snmp
checking for a BSD-compatible install... /usr/bin/ginstall -c
...
checking for iconv.h... yes
checking widec.h usability... yes
checking widec.h presence... yes
checking for widec.h... yes
checking for wchar_t... yes
checking for wint_t... yes
checking size of wchar_t... 4
checking for wcslen... yes
checking for wcsdup... yes
checking for wcsncpy... yes
checking for wcstoll... yes
checking for wcstoull... yes
checking for towupper... yes
checking for towlower... yes
checking for wcslwr... no
checking for wcserror... no
checking for wcserror_r... no
checking for wfopen... no
checking for wfopen64... no
checking for fputws... yes
checking for putws... yes
checking for wopen... no
checking for wstat... no
checking for waccess... no
checking for wgetenv... no
checking for wrename... no
checking for wunlink... no
checking for wremove... no
checking for wchdir... no
checking for wmkdir... no
checking for wrmdir... no
checking for wsystem... no
checking for wmkstemp... no
checking for wpopen... no
checking for wctime... no
checking for wchmod... no
checking for vwscanf... yes
checking for vswscanf... yes
checking for vfwscanf... yes
checking for wcscasecmp... yes
checking for wcsncasecmp... yes
checking for wcstombs... yes
checking for wcsrtombs... yes
checking for mbstowcs... yes
checking for mbsrtowcs... yes
checking for itow... no
checking for _itow... no
checking for wcsftime... yes
checking for wcstok... yes
checking whether putws is declared... no
checking whether wcsftime is working correctly... yes
checking for libiconv_open in -liconv... no
checking for iconv in -liconv... no
checking for iconv... yes
checking whether fgetws can be used with popen... yes
checking whether iconv supports UCS-2-INTERNAL... no
checking whether iconv supports UCS-2... yes
checking whether iconv supports UCS2... yes
checking whether iconv supports UCS-2BE... yes
checking whether iconv supports UCS-2LE... yes
checking whether iconv supports UTF-16... yes
checking whether iconv supports UCS-4-INTERNAL... no
checking whether iconv supports UCS-4... yes
checking whether iconv supports UCS4... yes
checking whether iconv supports UCS-4BE... yes
checking whether iconv supports UCS-4LE... yes
checking whether iconv supports UTF-32... yes
checking whether iconv supports //IGNORE... yes
checking whether iconv supports state reset... yes
checking whether iconv descriptor cache is needed... yes
checking for iconv declaration... const
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking whether PGRES_SINGLE_TUPLE is declared... yes
checking for floor in -lm... yes
checking for PQconnectdb in -lpq... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
...
config.status: executing libtool commands
Updating libtool



---------------------------------------------------------------------
                         Configure results
---------------------------------------------------------------------

Prefix                  : /opt/netxms
Platform                : SunOS
Shared library suffix   : .so
IPv6 support            : NO
Build Server            : YES
Server libs             : -lldap -llber  -ltermcap
LDAP support            : YES
XMPP support            : YES
ZeroMQ support          : YES
Encryption enabled      : YES
Build DB-Drivers        : pgsql sqlite
Build Clients           : NO
Build Agent             : YES
Subagents list          : sunos netsvc
Build Static Agent      : NO
UNICODE build           : NO
Use internal libexpat   : NO
Use internal libtre     : YES
Use internal libjansson : NO
Use internal sqlite     : NO
Use internal zlib       : NO
Force 32bit build       : NO
C compiler              : gcc
C++ compiler            : g++
CPPFLAGS                :  -D_THREAD_SAFE -DTRE_WCHAR=1 -I/opt/openssl/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D__EXTENSIONS__ -O2 -Wformat -Wno-unused-result -Werror=return-type -m64 -DPREFIX=\"${prefix}\" -DDATADIR=\"${pkgdatadir}\" -DBINDIR=\"${bindir}\" -DLIBDIR=\"${libdir}\" -DPKGLIBDIR=\"${pkglibdir}\" -DSTATEDIR=\"${localstatedir}/lib/netxms\" -DNDEBUG
CXXFLAGS                : -g -O2 -fno-rtti -fno-exceptions
CFLAGS                  : -g -O2
LDFLAGS                 :  -m64  -L/usr/local/lib -L/opt/openssl/lib
LIBS                    : -lm -lkvm -lexpat -lz -lresolv -lkstat -ldl -lsocket -lxnet  -lpthread -lssl -lcrypto
PostgreSQL CPPFLAGS     : -I/opt/postgres/9.5-pgdg/include
PostgreSQL LDFLAGS      : -L/opt/postgres/9.5-pgdg/lib
PostgreSQL LIBS         : -lpq
root@xms:~/NetXMS/netxms-2.0.5# make
./tools/updatetag.sh
make  all-recursive
Making all in .
...
Making all in libnetxms
  CXX      libnetxms_la-array.lo
...
  CXX      libnetxms_la-tools.lo
tools.cpp: In function 'bool ExtractNamedOptionValueW(const wchar_t*, const wchar_t*, wchar_t*, int)':
tools.cpp:1635:31: error: 'wcscasecmp' was not declared in this scope
      if (!wcsicmp(option, temp))
                               ^
tools.cpp:1635:31: note: suggested alternative:
In file included from ../../include/unicode.h:121:0,
                 from ../../include/nms_common.h:72,
                 from libnetxms.h:27,
                 from tools.cpp:23:
/usr/include/wchar.h:140:12: note:   'std::wcscasecmp'
extern int wcscasecmp(const wchar_t *, const wchar_t *);
            ^
tools.cpp: In function 'bool ExtractNamedOptionValueAsBoolW(const wchar_t*, const wchar_t*, bool)':
tools.cpp:1725:33: error: 'wcscasecmp' was not declared in this scope
   return !wcsicmp(buffer, L"yes") || !wcsicmp(buffer, L"true");
                                 ^
tools.cpp:1725:33: note: suggested alternative:
In file included from ../../include/unicode.h:121:0,
                 from ../../include/nms_common.h:72,
                 from libnetxms.h:27,
                 from tools.cpp:23:
/usr/include/wchar.h:140:12: note:   'std::wcscasecmp'
extern int wcscasecmp(const wchar_t *, const wchar_t *);
            ^
*** Error code 1
The following command caused the error:
echo "  CXX     " libnetxms_la-tools.lo;/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..  -I../../include  -D_THREAD_SAFE -DTRE_WCHAR=1 -I/opt/openssl/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D__EXTENSIONS__ -O2 -Wformat -Wno-unused-result -Werror=return-type -m64 -DPREFIX=\"/opt/netxms\" -DDATADIR=\"/opt/netxms/share/netxms\" -DBINDIR=\"/opt/netxms/bin\" -DLIBDIR=\"/opt/netxms/lib\" -DPKGLIBDIR=\"/opt/netxms/lib/netxms\" -DSTATEDIR=\"/opt/netxms/var/lib/netxms\" -DNDEBUG  -g -O2 -fno-rtti -fno-exceptions -MT libnetxms_la-tools.lo -MD -MP -MF .deps/libnetxms_la-tools.Tpo -c -o libnetxms_la-tools.lo `test -f 'tools.cpp' || echo './'`tools.cpp
make: Fatal error: Command failed for target `libnetxms_la-tools.lo'
Current working directory /root/NetXMS/netxms-2.0.5/src/libnetxms
*** Error code 1
The following command caused the error:
fail=; \
if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_with_option: internal error: invalid"  "target option '${target_option-}' specified" >&2;  exit 1;;  esac;  has_opt=no;  sane_makeflags=$MAKEFLAGS;  if test -n '' && test -n '2'; then  sane_makeflags=$MFLAGS;  else  case $MAKEFLAGS in  *\\[\ \    ]*)  bs=\\;  sane_makeflags=`printf '%s\n' "$MAKEFLAGS"  | sed "s/$bs$bs[$bs $bs        ]*//g"`;;  esac;  fi;  skip_next=no;  strip_trailopt ()  {  flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;  };  for flg in $sane_makeflags; do  test $skip_next = yes && { skip_next=no; continue; };  case $flg in  *=*|--*) continue;;  -*I) strip_trailopt 'I'; skip_next=yes;;  -*I?*) strip_trailopt 'I';;  -*O) strip_trailopt 'O'; skip_next=yes;;  -*O?*) strip_trailopt 'O';;  -*l) strip_trailopt 'l'; skip_next=yes;;  -*l?*) strip_trailopt 'l';;  -[dEDm]) skip_next=yes;;  -[JT]) skip_next=yes;;  esac;  case $flg in  *$target_option*) has_opt=yes; break;;  esac;  done;  test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='libtre libstrophe libnetxms tools install snmp appagent libnxlp db agent libnxmap libnxsl libnxcc server smsdrv nxscript' ;; \
  *) list='libtre libstrophe libnetxms tools install snmp appagent libnxlp db agent libnxmap libnxsl libnxcc server smsdrv nxscript' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /root/NetXMS/netxms-2.0.5/src
*** Error code 1
The following command caused the error:
fail=; \
if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_with_option: internal error: invalid"  "target option '${target_option-}' specified" >&2;  exit 1;;  esac;  has_opt=no;  sane_makeflags=$MAKEFLAGS;  if test -n '' && test -n '1'; then  sane_makeflags=$MFLAGS;  else  case $MAKEFLAGS in  *\\[\ \    ]*)  bs=\\;  sane_makeflags=`printf '%s\n' "$MAKEFLAGS"  | sed "s/$bs$bs[$bs $bs        ]*//g"`;;  esac;  fi;  skip_next=no;  strip_trailopt ()  {  flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;  };  for flg in $sane_makeflags; do  test $skip_next = yes && { skip_next=no; continue; };  case $flg in  *=*|--*) continue;;  -*I) strip_trailopt 'I'; skip_next=yes;;  -*I?*) strip_trailopt 'I';;  -*O) strip_trailopt 'O'; skip_next=yes;;  -*O?*) strip_trailopt 'O';;  -*l) strip_trailopt 'l'; skip_next=yes;;  -*l?*) strip_trailopt 'l';;  -[dEDm]) skip_next=yes;;  -[JT]) skip_next=yes;;  esac;  case $flg in  *$target_option*) has_opt=yes; break;;  esac;  done;  test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='. m4 src doc tools contrib  sql images' ;; \
  *) list='. m4 src doc tools contrib  sql images' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /root/NetXMS/netxms-2.0.5
*** Error code 1
make: Fatal error: Command failed for target `all'

#2
В библиотеке скриптов имеется скрипт, который вызывается из transformation script и которому передаются в качестве аргументов custom attributes объекта. Захотел использовать новую возможность, указал этот скрипт как параметр метрики в виде DCI::NumOfLearnedMAC($node->node,$node->vlan,$node->port). Скрипт завершается со значением -1, говорящим о том, что ему не передаются аргументы.... может их как-то по другому надо указывать?

Ниже сам скрипт

// Count MAC adresses, learned on port of vlan on node
// Arguments: node, vlan, port
// Return number of learned MAC address

sub main() {
return NumOfLearnedMAC($1,$2,$3);
}

sub NumOfLearnedMAC() {
node = FindObject($1);
vlan = $2;
port = $3;

if (node == null)
{
    println "ERROR: Node not found";
    return -1;
}

transport = CreateSNMPTransport(node);    // Create SNMP transport for node
if (transport == null)
{
    println "Failed to create SNMP transport, exit";
    return -1;
}

vars = SNMPWalk(transport, ".1.3.6.1.2.1.17.7.1.2.2.1.2.".vlan);
if (vars == null)
{
    println "Failed to issue SNMP WALK request";
    return -2;
}

ret = 0;
foreach (v: vars) {
  if (v->value == port)
  {
    ++ret;
  }
}

return ret;
}


... и transformation script

use DCI::NumOfLearnedMAC;

sub main() {
return NumOfLearnedMAC($node->node,$node->vlan,$node->port);
}

#3
Подскажите пожалуйста, а где можно взять JIRA Plug-In? Документацию по интеграции нашел, а вот сам плагин что-то нигде не обнаружил...
#4
Прошу разработчиков рассмотреть реализацию следующей возможности:

1. Ввести признак скрытого атрибута - либо добавить для каждого атрибута отдельное поле признака, либо просто по наличию специального первого символа в его имени. Предположим "_". Тогда имя скрытого атрибута пароля будет выглядеть как "_password"
2. В списке атрибутов и диалоге редактирования атрибута всегда отображать значение скрытого атрибута как "***"
3. Добавить для пользователя/группы привилегию "ShowHiddenAttributes"
4. Для пользователя с привилегией "ShowHiddenAttributes" показывать реальное значение скрытого атрибута только диалоге редактирования атрибута. Можно, конечно, потешить паранойю и добавить дополнительный запрос пароля пользователя перед показом :)
#5
Здравствуйте уважаемые!

Помогите пожалуйста со сборкой subj с поддержкой Unicode? Без Unicode все собирается прекрасно (ну почти!).
Пытаюсь собрать с Unicode (установлена libiconv-1.14):

-bash-3.2# CFLAGS=-I/usr/local/include CPPFLAGS=-I/usr/local/include LIBS=-L/usr/local/lib/ ./configure --with-server --with-sqlite --prefix=/opt/netxms --disable-64bit --with-pgsql --with-agent --with-openssl --enable-unicode
...
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for wchar_t... yes
checking for wint_t... yes
checking size of wchar_t... 4
checking for wcslen... yes
checking for wcsdup... no
checking for wcsncpy... yes
checking for wcstoll... yes
checking for wcstoull... yes
checking for towupper... yes
...
checking for wcscasecmp... no
checking for libiconv_open in -liconv... yes
checking for libiconv... yes
checking whether iconv supports UCS-2-INTERNAL... yes
checking whether iconv supports UCS-2... yes
checking whether iconv supports UCS2... no
checking whether iconv supports UCS-2BE... yes
checking whether iconv supports UCS-2LE... yes
checking whether iconv supports UTF-16... yes
checking whether iconv supports UCS-4-INTERNAL... yes
checking whether iconv supports UCS-4... yes
checking whether iconv supports UCS4... no
checking whether iconv supports UCS-4BE... yes
checking whether iconv supports UCS-4LE... yes
checking whether iconv supports UTF-32... yes
checking whether iconv supports ISO8859-1... yes
checking whether iconv supports ISO-8859-1... yes
checking whether iconv supports ASCII... yes
checking whether iconv supports //IGNORE... yes
checking for iconv declaration... const
checking for floor in -lm... yes
...
---------------------------------------------------------------------
                         Configure results
---------------------------------------------------------------------

Prefix                  : /opt/netxms
Build Server            : YES
Server libs             :  -lssl -ltermcap
Encryption enabled      : YES
Build DB-Drivers        : pgsql sqlite
Build Clients           : NO
Build Agent             : YES
Subagents list          : sunos
Build Static Agent      : NO
UNICODE build           : YES
Use internal libexpat   : NO
Use internal libtre     : YES
Use internal zlib       : NO
Force 32bit build       : YES
C compiler              : gcc
C++ compiler            : g++
CPPFLAGS                : -I/usr/local/include -D_THREAD_SAFE -DTRE_WCHAR=1 -I/usr/local/pgsql/include -I/usr/include/pgsql -I/usr/pgsql/include -I/usr/local/include/pgsql -I/usr/local/pgsql/include/pgsql -I/usr/pgsql/include/pgsql -I/usr/local/postgresql/include -I/usr/include/postgresql -I/usr/postgresql/include -I/usr/local/include/postgresql -I/usr/local/postgresql/include/postgresql -I/usr/postgresql/include/postgresql -I/opt/openssl/include -DUNICODE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m32 -I/usr/local/include -DPREFIX=L\"${prefix}\" -DDATADIR=L\"${pkgdatadir}\" -DBINDIR=L\"${bindir}\" -DLIBDIR=L\"${libdir}\" -DPKGLIBDIR=L\"${pkglibdir}\"
CXXFLAGS                : -g -O2 -fno-rtti -fno-exceptions
CFLAGS                  : -I/usr/local/include
LDFLAGS                 :  -m32  -L/usr/local/pgsql/lib -L/usr/lib64/pgsql -L/usr/lib/pgsql -L/usr/pgsql/lib -L/usr/local/lib/pgsql -L/usr/local/pgsql/lib/pgsql -L/usr/pgsql/lib/pgsql -L/usr/local/postgresql/lib -L/usr/lib/postgresql -L/usr/postgresql/lib -L/usr/local/lib/postgresql -L/usr/local/postgresql/lib/postgresql -L/usr/postgresql/lib/postgresql -L/usr/local/lib -L/opt/openssl/lib -L/usr/local/lib
LIBS                    : -lm -lkvm -lexpat -lz -lkstat -ldl -lsocket -lxnet -lcrypto -lcrypto -lcrypto -L/usr/local/lib/ -lpthread -liconv
PostgreSQL libs         : -lpq

-bash-3.2# make
make  all-recursive
...
Making all in libnetxms
make[3]: Entering directory `/export/src/netxms-1.2.8/src/libnetxms'
  CXX    libnetxms_la-agent.lo
In file included from libnetxms.h:28,
                 from agent.cpp:24:
../../include/nms_util.h: In member function `void StringMap::set(const wchar_t*, const wchar_t*)':
../../include/nms_util.h:282: error: `wcsdup' undeclared (first use this function)
../../include/nms_util.h:282: error: (Each undeclared identifier is reported only once for each function it appears in.)
../../include/nms_util.h: In member function `void TableColumnDefinition::setDisplayName(const wchar_t*)':
../../include/nms_util.h:490: error: `wcsdup' undeclared (first use this function)
../../include/nms_util.h: In member function `void Table::setTitle(const wchar_t*)':
../../include/nms_util.h:531: error: `wcsdup' undeclared (first use this function)
../../include/nms_util.h: At global scope:
../../include/nms_util.h:1116: error: `wchar_t* wcsdup(const wchar_t*)' used prior to declaration
make[3]: *** [libnetxms_la-agent.lo] Error 1
make[3]: Leaving directory `/export/src/netxms-1.2.8/src/libnetxms'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/export/src/netxms-1.2.8/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/export/src/netxms-1.2.8'
make: *** [all] Error 2

И вот на основании вышеизложенного возникает извечный русский вопрос: Что делать? :)