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

Messages - Alex Kirhenshtein

#1036
Примерно так:

sub main()
{
if ($1 > 0 && $1 <= 500000) {
return $1;
}

return 0;
}


Кстати, для отладки можно использовать nxscript из комплекта - return-ы заменить на print-ы:
sub main()
{
if ($1 > 0 && $1 <= 500000) {
print $1;
}

print 0;
}


C:\NetXMS\bin>nxscript.exe test.nxc 12345
NetXMS Scripting Host  Version 0.2.19
Copyright (c) 2005, 2006 Victor Kirhenshtein

123450


C:\NetXMS\bin>nxscript.exe test.nxc 1234567
NetXMS Scripting Host  Version 0.2.19
Copyright (c) 2005, 2006 Victor Kirhenshtein

0
#1037
Quote from: Victor Kirhenshtein on March 16, 2008, 09:05:15 PM
... and usage of an agent gives you some additional benefits:

Also, I should note, that you need to deploy them by hand only once. Later, when agent is up and running, you can upgrade it from management console in few clicks.
#1038
Hello.

Unfortunately, https is not yet supported (oh, it was planed months ago...).
As temporary workaround — you can use either external script (with something like curl https://... | grep "keyword | ... ) or setup something like stunnel and configure sevices in netxms (check Victor's link for that).

However, I'll try to put encryption on a schedule for upcoming 0.2.20.
#1039
General Support / Re: DATE fields in mysql database.
January 25, 2008, 07:02:09 PM
Hello.

Date is stored as unix timestamp (number of seconds since 1/1/1970), in php you can convert it to human readable form using date() function.

idata_xx tables contains per-node history data for each DCI (e.g. cpu usage values for retention period), where "xx" is "id" from table "nodes".


p.s. please keep in mind that server keeps operational data in memory and flushing changes in a background, so information in database can be sometimes out of sync or outdated (only while server is running - everything is flushed on shutdown, of course) - especially under heavy load.
p.p.s. you can make some assumptions about out of sync delay by looking at Server.AverageDBWriterQueueSizeAverage DCI.
#1040
Можно получить используя PDH  и различные performance counters.

Пример конфигурации, дописать в nxagentd.conf:

[code]*WinPerf
Counter = DiskWriteBytes:"\PhysicalDisk(_Total)\Disk Write Bytes/sec":60:A:INT:Average number of bytes per second written to disk for last minute


Где:

"*WinPerf" - название секции конфига, относится только к winperf субагенту
"Counter" - описание счетчика. Формат:
   Counter = НазваниеПараметраДляNetXMS:"\Название_PDH_каунтера":количество_семплов:очередь:тип:Описание параметра[/code]

"НазваниеПараметраДляNetXMS" - то, что видно в в консоли, при настройке DCI-ев
"\Название_PDH_каунтера" - я не знаю, как оно называется в русской системе, можно посмотреть в administrative tools -> performance. Для английской системы - \Network Interface(название интерфейса)\Current Bandwidth.
количество_семплов - количество семплов для подсчета average
очередь - варианты: A, B, C. A - опрос раз в секунду, B - раз в 5 секунд, C - раз в 30.

т.е. если указать количество_семплов=60 и очередь=A, то результат будет равен среднему значению за минуту. А 30 и C - average за 15 минут.
#1041
General Support / Re: Log.Scan()?
January 11, 2008, 05:30:55 PM
Hello.

Actually, log scanner in it current state is a more a hack than a production grade code - it was made for a specific task.
However, you can try to use it:

1) while logscan subagent is already included in windows version (i believe so), you should compile it manually on unix (or add "--enable-unstable" parameter to configure, this will enable some additional features, including logscan subagent):
$ cd netxms-VERSION
$ ./configure ...
$ cd src/agent/subagents/logscan
$ make install


2) add libnsm_logscan.so/logscan.nsm to you nxagentd.conf (SubAgent parameter)
3) now you can call LogScan.FindString parameter with two arguments: filename and substring to search. If substring is found - whole string returned, empty string otherwise.

LogScan works on per-line basis; it stops search when substring is found, so if you have multiple lines matching - FindString will return them all. Position in file is persisted between requests; log rotation is detected only by file size (e.g. if last known file position is beyond the end of file)

wbr, alex.
#1042
Общие вопросы / Re: win-console
December 06, 2007, 12:57:22 PM
А минидампа не осталось?
#1043
Quote from: Retter on November 30, 2007, 10:52:06 AM
2007-11-30 15:59:37 FATAL:  no pg_hba.conf entry for host "::1", user "postgres", database "template1", SSL off

Это значит, что пытались подключится на localhost по IPv6, юзером postgres на базу template1.

Покажите netxmsd.conf, пожалуйста.
#1044
General Support / Re: GD on Fedora
November 16, 2007, 03:10:22 PM
You should install -dev packaged for GD.

Update: this should do the trick:
yum install gd-devel
#1045
General Support / Re: wrong disk space
November 14, 2007, 11:48:51 AM
Try to use mount point name instead of device name.

Update: it looks like a bug, i just reproduced it on fresh Ubuntu.
#1046
В принципе, некогда оно всё работало (в 0.2.10?) - присылайте лог на alk ~ netxms.org (или сюда аттачем, скажем) - будем смотреть.

Правда у нас сейчас нет живых машин с 9-м солярисом, но у меня валяются пара 60-х ультр - попробую их запустить - но не обещаю, что это будет быстро.
#1047
На данный момент нет. В систему заложена возможность поддержки распределенного мониторинга, но она не реализована до конца - просто на данный момент никому из наших клинтов это не потребовалось, и фича была отложена до появления деманда.
#1048
Да, можно.

На роутере нужно поставить nxagentd и в его конфиге включить прокси:

#
# EnableProxy
#
# Allow requests forwarding
# Default value is "no"
#
# Example:
# EnableProxy = no

После чего в properties ноды указать этот роутер как proxy.

Для проверки proxy-части, можно с сервера запустить nxget:

nxget -X [router_ip] [node_ip] Agent.Version
#1049
ExternalParameter = MyParameterName(*):/usr/bin/perl /usr/local/bin/myscript.pl $1



Из nxagentd.conf:

#
# ExternalParameter
#
# Add parameter handled by external command. To add multiple parameters, you
# should use multiple ExternalParameter entries. Please note that on Windows
# agent uses system process execution API for execution of specified
# command, so you cannot use pipes or shell commands. If you need to
# execute command via shell, use ExternalParameterShellExec instead.
#
# Syntax:
# ExternalParameter = <parameter_name>:<command_line>
# If you specify parameter name as "name(*)", then you can use $1 .. $9 in
# command line to substitute actual arguments passed from server.
#
# Examples:
# ExternalParameter = Test:echo test
# ExternalParameter = LineCount(*):cat $1 | wc -l
# ExternalParameter = Test2(*):myprog $1 $2
#1050
Quote from: Alex on October 12, 2007, 11:52:41 PM
Каким макаром можно послать письмо по IMAP (как я понимаю Вы именно это имели в виду)?

На самом деле была такая фича, что письмо отслылается через IMAP - т.е. оно складывается клиентом в /Outbox, и уже оттуда сервер его пересылает дальше (SMTP, UUCP, почтовые голуби). Но в реальной жизни  я такого никогда не видел.