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 - user318

#1
Было бы хорошо, если бы ExternalParameter учитывали код возврата. И если он не 0, то считалось, что параметр не удалось прочитать. А то сейчас вроде если скритп возвращает пустую сточку, например, то в консоли я вижу, что пришёл какой-то мусор. А хотелось бы иметь возможность из скрипта "сообщать" о сбое при опросе параметра.
#2
Есть ли вычисляемые параметры? Или как их можно заменить?
Нужно, например, для выставления уровней, учитывающих несколько других параметров. Например есть счётчкик запросов и ошибочных запросов, хочется проверять, что их отношение не больше стольки-то. Так можно было бы сделать параметр-отношение этих счётчиков и на него поставить уровень тревоги.
#3
Если запусть configure так:
./configure --prefix=/opt/netxms --with-pic --with-gnu-ld --with-agent --without-server --without-snmp --without-mysql --without-pgsql --without-sqlite
То оно закончится с ошибкой:
configure: error: You must select at least one database driver when building server.
Хотя ведь опция "server" не включена и более того принудительно выключена.
#4
Можно выкладывать новые версии netxms не только в https://www.netxms.org/download/*, но и сразу в архив? Т.к. неудобно, например, писать ебилды в gentoo, да и в других случаях, мне кажется, неудобно. Нет постоянного места откуда можно скачать исходник. После того, как выходит новая версия, его URL меняется и приходится обновлять скрипты.
#5
Я собрал netxms 1.2.2, пытаюсь запустить демона, а он в лог говорит такое:
Error creating data directory "/opt/netxms/share/netxms/packages"
Раньше пользовался версиями до 1.1.10 - они такого не хотели, в share/netxms было только aclocal зачем-то.
Зачем оно хочет туда записывать? Если тот же configure говорит, что:
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
Т.е. read-only! Ну и FHS:
http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA
тоже так думает. Т.е. это общепринято, что туда писать во время работы ничего не надо.
#6
Почему-то у меня под gentoo с параметром CFLAGS/CXXFLAGS=-O2 собирается пакет. А если убрать -O2, то выдаёт такое:

Making all in netxmsd
make[4]: Entering directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/server/netxmsd'
  CXX    netxmsd.o
netxmsd.cpp: In function 'BOOL ParseCommandLine(int, char**)':
netxmsd.cpp:206:29: warning: format not a string literal and no format arguments
netxmsd.cpp:209:96: warning: use of 'h' length modifier with 's' type character
netxmsd.cpp:231:84: warning: use of 'h' length modifier with 's' type character
netxmsd.cpp: In function 'int main(int, char**)':
netxmsd.cpp:417:77: warning: use of 'h' length modifier with 's' type character
  CXXLD  netxmsd
../core/.libs/libnxcore.so: undefined reference to `ServiceContainer::secondsInWeek'
../core/.libs/libnxcore.so: undefined reference to `ServiceContainer::secondsInDay'
collect2: ld returned 1 exit status
make[4]: *** [netxmsd] Error 1
make[4]: Leaving directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/server/netxmsd'

Сейчас ещё проверил другие варианты:
-O0 - не собирается (что и следовало ожидать)
-O1 - собирается
-Os - собирается
-O3 - собирается
Ну т.е. начиная с -O1 собирается.
Пробовал просто включить флаги оптимизации, указанные в мане для -O1 - не собралось. Видимо -O1 ещё какую-то магию делает.
#7
Общие вопросы / snprintf overflow
December 05, 2011, 06:44:12 PM
У меня netxmsd аварийно завершается при определённых действиях. Дебаг-символы и бектрейс показали, что валится на вызове _sntprintf.

src/server/core/subnet.cpp, функция void Subnet::setCorrectMask(DWORD dwAddr, DWORD dwMask):

                // Change name
                _sntprintf(m_szName, 128, _T("%s/%d"), IpToStr(dwAddr, szBuffer), BitsInMask(dwMask));


Как я понял из src/server/include/nms_objects.h определение m_szName (наследуется Subnet от NetObj) такое:
TCHAR m_szName[MAX_OBJECT_NAME];

MAX_OBJECT_NAME нашёл в include/nxlog.h:
#define MAX_OBJECT_NAME          64

Где что менять теперь? :)
#8
Делаю:
./configure --prefix=/opt/netxms --with-agent
make
make DESTDIR=... install

Получаю ошибку:
...
make  install-exec-hook
make[6]: Entering directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/agent/subagents/portCheck'
if test "x`uname -s`" = "xAIX" ; then OBJECT_MODE= ar x /opt/netxms/lib/netxms/portcheck.a /opt/netxms/lib/netxms/portcheck.so ; rm -f /opt/netxms/lib/netxms/portcheck.a ; fi
mv /opt/netxms/lib/netxms/portcheck.so /opt/netxms/lib/netxms/portcheck.nsm
mv: cannot stat `/opt/netxms/lib/netxms/portcheck.so': No such file or directory
make[6]: *** [install-exec-hook] Error 1
make[6]: Leaving directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/agent/subagents/portCheck'
make[5]: *** [install-exec-am] Error 2
...

Система gentoo.
#9
Делаю:
./configure --prefix=/opt/netxms --with-agent --enable-unicode
make

Получаю:
...
make[3]: Entering directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/libnetxms'
  CXX    agent.lo
  CXX    array.lo
  CXX    base64.lo
  CXX    crypto.lo
  CC     gen_uuid.lo
  CXX    config.lo
  CXX    geolocation.lo
crypto.cpp: In function 'RSA* LoadRSAKeys(const wchar_t*)':
crypto.cpp:476: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
  CXX    dload.lo
config.cpp: In member function 'bool Config::loadConfigDirectory(const wchar_t*, const wchar_t*)':
config.cpp:1086: error: 'DIRW' was not declared in this scope
config.cpp:1086: error: 'dir' was not declared in this scope
config.cpp:1091: error: 'wopendir' was not declared in this scope
config.cpp:1097: error: 'wreaddir' was not declared in this scope
config.cpp:1101: error: invalid use of incomplete type 'struct dirent_w'
config.cpp:1087: error: forward declaration of 'struct dirent_w'
config.cpp:1101: error: invalid use of incomplete type 'struct dirent_w'
config.cpp:1087: error: forward declaration of 'struct dirent_w'
config.cpp:1104: error: invalid use of incomplete type 'struct dirent_w'
config.cpp:1087: error: forward declaration of 'struct dirent_w'
config.cpp:1110: error: invalid use of incomplete type 'struct dirent_w'
config.cpp:1087: error: forward declaration of 'struct dirent_w'
config.cpp:1114: error: 'wclosedir' was not declared in this scope
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-result"
make[3]: *** [config.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-result"
geolocation.cpp:239:1: error: converting to execution character set: Invalid or incomplete multibyte or wide character
geolocation.cpp: In member function 'void GeoLocation::posToString(bool, double)':
geolocation.cpp:189: error: converting to execution character set: Invalid or incomplete multibyte or wide character
geolocation.cpp: In static member function 'static double GeoLocation::parse(const wchar_t*, bool, bool*)':
geolocation.cpp:215: error: converting to execution character set: Invalid or incomplete multibyte or wide character
geolocation.cpp:215: error: converting to execution character set: Invalid or incomplete multibyte or wide character
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-result"
make[3]: *** [geolocation.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src/libnetxms'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/net-analyzer/netxms-1.1.6/work/netxms-1.1.6/src'
...

Система gentoo.

Так же заметил, что если в параметрах указать --disable-unicode, то это воспринимается как --enable-unicode.