[SVN-NetXMS] revision 3366

From: NetXMS.org SVN Server <svn_at_DOMAIN_REMOVED>
Date: Sat, 5 Jul 2008 13:14:42 +0300

* { font-family: Consolas, Lucida Console, Courier New; font-size: 100%; }
h1 { font-size: 150%; }
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 100%; width: 100%; }
.highlight span { width: 100%; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
body { background: #ffffff; }
body .c { color: #999988; font-style: italic } /* Comment */
body .err { color: #a61717; background-color: #e3d2d2 } /* Error */
body .k { font-weight: bold } /* Keyword */
body .o { font-weight: bold } /* Operator */
body .cm { color: #999988; font-style: italic } /* Comment.Multiline */
body .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
body .c1 { color: #999988; font-style: italic } /* Comment.Single */
body .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
body .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #aa0000 } /* Generic.Error */
body .gh { color: #999999 } /* Generic.Heading */
body .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
body .go { color: #888888 } /* Generic.Output */
body .gp { color: #555555 } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #aaaaaa } /* Generic.Subheading */
body .gt { color: #aa0000 } /* Generic.Traceback */
body .kc { font-weight: bold } /* Keyword.Constant */
body .kd { font-weight: bold } /* Keyword.Declaration */
body .kp { font-weight: bold } /* Keyword.Pseudo */
body .kr { font-weight: bold } /* Keyword.Reserved */
body .kt { color: #445588; font-weight: bold } /* Keyword.Type */
body .m { color: #009999 } /* Literal.Number */
body .s { color: #bb8844 } /* Literal.String */
body .na { color: #008080 } /* Name.Attribute */
body .nb { color: #999999 } /* Name.Builtin */
body .nc { color: #445588; font-weight: bold } /* Name.Class */
body .no { color: #008080 } /* Name.Constant */
body .ni { color: #800080 } /* Name.Entity */
body .ne { color: #990000; font-weight: bold } /* Name.Exception */
body .nf { color: #990000; font-weight: bold } /* Name.Function */
body .nn { color: #555555 } /* Name.Namespace */
body .nt { color: #000080 } /* Name.Tag */
body .nv { color: #008080 } /* Name.Variable */
body .ow { font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #009999 } /* Literal.Number.Float */
body .mh { color: #009999 } /* Literal.Number.Hex */
body .mi { color: #009999 } /* Literal.Number.Integer */
body .mo { color: #009999 } /* Literal.Number.Oct */
body .sb { color: #bb8844 } /* Literal.String.Backtick */
body .sc { color: #bb8844 } /* Literal.String.Char */
body .sd { color: #bb8844 } /* Literal.String.Doc */
body .s2 { color: #bb8844 } /* Literal.String.Double */
body .se { color: #bb8844 } /* Literal.String.Escape */
body .sh { color: #bb8844 } /* Literal.String.Heredoc */
body .si { color: #bb8844 } /* Literal.String.Interpol */
body .sx { color: #bb8844 } /* Literal.String.Other */
body .sr { color: #808000 } /* Literal.String.Regex */
body .s1 { color: #bb8844 } /* Literal.String.Single */
body .ss { color: #bb8844 } /* Literal.String.Symbol */
body .bp { color: #999999 } /* Name.Builtin.Pseudo */
body .vc { color: #008080 } /* Name.Variable.Class */
body .vg { color: #008080 } /* Name.Variable.Global */
body .vi { color: #008080 } /* Name.Variable.Instance */
body .il { color: #009999 } /* Literal.Number.Integer.Long */

Info

Revision:3366
Author:victor

Date:2008-07-05 13:14:42 +0300 (Sat, 05 Jul 2008)

Comment:fixed UNICIDE issues in NetWare; added parameters System.IO.DiskQueue and System.IO.OpenFiles to NetWare subagent

Changes
U trunk/include/config-netware.h
U trunk/include/unicode.h
U trunk/netware/nlmconv.inc
U trunk/src/agent/subagents/netware/netware.cpp
U trunk/src/libnetxms/Makefile.nw

Diff
Modified: trunk/include/config-netware.h
===================================================================
--- trunk/include/config-netware.h 2008-07-04 07:27:33 UTC (rev 3365)
+++ trunk/include/config-netware.h 2008-07-05 10:14:42 UTC (rev 3366)
@@ -22,10 +22,10 @@
 #define HAVE_WCHAR_T 1
 
 /* Define to 1 if you have the `iconv&#39; function. */
-#define HAVE_ICONV 1
+//#define HAVE_ICONV 1
 
 /* Define to 1 if you have the &lt;iconv.h&gt; header file. */
-#define HAVE_ICONV_H 1
+//#define HAVE_ICONV_H 1
 
 /* Define to 1 if iconv supports //IGNORE option */
 #define HAVE_ICONV_IGNORE 1

Modified: trunk/include/unicode.h
===================================================================
--- trunk/include/unicode.h 2008-07-04 07:27:33 UTC (rev 3365)
+++ trunk/include/unicode.h 2008-07-05 10:14:42 UTC (rev 3366)
@@ -80,6 +80,13 @@
 
 #else /* not _WIN32 */
 
+#if defined(_NETWARE) &amp;&amp; defined(__GNUC__) &amp;&amp; defined(__cplusplus)
+#define _WCHAR_T
+#define _WCHAR_T_DEFINED
+#define wchar_t unsigned short
+#endif
+
+
 #if HAVE_WCHAR_H
 #include &lt;wchar.h&gt;
 #endif

Modified: trunk/netware/nlmconv.inc
===================================================================
--- trunk/netware/nlmconv.inc 2008-07-04 07:27:33 UTC (rev 3365)
+++ trunk/netware/nlmconv.inc 2008-07-05 10:14:42 UTC (rev 3366)
@@ -3,5 +3,5 @@
 IMPORT @c:/nwsdk/libc/imports/libc.imp
 IMPORT @c:/nwsdk/libc/imports/netware.imp
 
-VERSION 0,2,21
+VERSION 0,2,22
 COPYRIGHT &quot;Copyright (c) 2004, 2005, 2006, 2007, 2008 NetXMS Team&quot;

Modified: trunk/src/agent/subagents/netware/netware.cpp
===================================================================
--- trunk/src/agent/subagents/netware/netware.cpp 2008-07-04 07:27:33 UTC (rev 3365)
+++ trunk/src/agent/subagents/netware/netware.cpp 2008-07-05 10:14:42 UTC (rev 3366)
@@ -34,13 +34,15 @@
 static THREAD m_hCollectorThread = INVALID_THREAD_HANDLE;
 static int m_iCpuUtilHistory[MAX_CPU][CPU_HISTORY_SIZE];
 static int m_iCpuHPos = 0;
+static int m_iDiskQueuePos = 0;
+static int m_iDiskQueue[60];
 
 
 //
 // Memory information
 //
 
-static LONG H_MemoryInfo(char *pszParam, char *pArg, char *pValue)
+static LONG H_MemoryInfo(const char *pszParam, const char *pArg, char *pValue)
 {
         struct memory_info info;
         size64_t nTotalMem;
@@ -80,7 +82,7 @@
 // Disk information
 //
 
-static LONG H_DiskInfo(char *pszParam, char *pArg, char *pValue)
+static LONG H_DiskInfo(const char *pszParam, const char *pArg, char *pValue)
 {
         struct volume_info vi;
         char szVolumeName[MAX_VOLUME_NAME_LEN + 1];
@@ -123,7 +125,7 @@
 // Host name
 //
 
-static LONG H_HostName(char *pszParam, char *pArg, char *pValue)
+static LONG H_HostName(const char *pszParam, const char *pArg, char *pValue)
 {
         char szName[256];
         int iErr;
@@ -139,7 +141,7 @@
 // CPU usage
 //
 
-static LONG H_CpuUsage(char *pszParam, char *pArg, char *pValue)
+static LONG H_CpuUsage(const char *pszParam, const char *pArg, char *pValue)
 {
         int i, j, iSteps, iValue, iCpu, iCpuCount;
         char szBuffer[256];
@@ -182,7 +184,7 @@
 // CPU count
 //
 
-static LONG H_CpuCount(char *pszParam, char *pArg, char *pValue)
+static LONG H_CpuCount(const char *pszParam, const char *pArg, char *pValue)
 {
         ret_uint(pValue, NXGetCpuCount());
         return SYSINFO_RC_SUCCESS;
@@ -193,7 +195,7 @@
 // Platform name
 //
 
-static LONG H_PlatformName(char *pszParam, char *pArg, char *pValue)
+static LONG H_PlatformName(const char *pszParam, const char *pArg, char *pValue)
 {
         ret_string(pValue, &quot;netware-i386&quot;);
         return SYSINFO_RC_SUCCESS;
@@ -201,10 +203,46 @@
 
 
 //
+// Open files
+//
+
+static LONG H_OpenFiles(const char *pszParam, const char *pArg, char *pValue)
+{
+ struct filesystem_info fsi;
+
+ if (netware_fs_info(&amp;fsi) != 0)
+ return SYSINFO_RC_ERROR;
+ ret_int(pValue, fsi.OpenFileCount);
+ return SYSINFO_RC_SUCCESS;
+}
+
+
+//
+// Average disk queue
+//
+
+static LONG H_DiskQueue(const char *pszParam, const char *pArg, char *pValue)
+{
+ int i, iSteps, iValue;
+ char szBuffer[256];
+
+ for(i = m_iDiskQueuePos - 1, iValue = 0, iSteps = 60; iSteps &gt; 0; iSteps--, i--)
+ {
+ if (i &lt; 0)
+ i = 59;
+ iValue += m_iDiskQueue[i];
+ }
+
+ ret_double(pValue, ((double)iValue / 60.0));
+ return SYSINFO_RC_SUCCESS;
+}
+
+
+//
 // ARP cache
 //
 
-static LONG H_ArpCache(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
+static LONG H_ArpCache(const char *pszParam, const char *pArg, NETXMS_VALUES_LIST *pValue)
 {
         return SYSINFO_RC_UNSUPPORTED;
 }
@@ -244,6 +282,7 @@
 {
         struct cpu_info ci;
         int iSeq, iCpu, iNumCpu;
+ struct filesystem_info fsi;
 
         while(1)
         {
@@ -268,6 +307,15 @@
                 m_iCpuHPos++;
                 if (m_iCpuHPos == CPU_HISTORY_SIZE)
                         m_iCpuHPos = 0;
+
+ // Disk queue
+ if (netware_fs_info(&amp;fsi) == 0)
+ {
+ m_iDiskQueue[m_iDiskQueuePos] = fsi.CurrentDiskRequests;
+ m_iDiskQueuePos++;
+ if (m_iDiskQueuePos == 60)
+ m_iDiskQueuePos = 0;
+ }
         }
         return THREAD_OK;
 }
@@ -281,6 +329,7 @@
 {
         // Setup internal variables
         memset(m_iCpuUtilHistory, 0, sizeof(int) * CPU_HISTORY_SIZE * MAX_CPU);
+ memset(m_iDiskQueue, 0, sizeof(int) * 60);
 
         // Start collector thread
         m_hCondShutdown = ConditionCreate(TRUE);
@@ -324,6 +373,8 @@
         { &quot;System.CPU.Usage(*)&quot;, H_CpuUsage, (char *)60, DCI_DT_FLOAT, DCIDESC_SYSTEM_CPU_USAGE_EX },
         { &quot;System.CPU.Usage5(*)&quot;, H_CpuUsage, (char *)300, DCI_DT_FLOAT, DCIDESC_SYSTEM_CPU_USAGE5_EX },
         { &quot;System.CPU.Usage15(*)&quot;, H_CpuUsage, (char *)900, DCI_DT_FLOAT, DCIDESC_SYSTEM_CPU_USAGE15_EX },
+ { &quot;System.IO.DiskQueue&quot;, H_DiskQueue, NULL, DCI_DT_FLOAT, _T(&quot;Average disk queue length for last minute&quot;) },
+ { &quot;System.IO.OpenFiles&quot;, H_OpenFiles, NULL, DCI_DT_INT, _T(&quot;Number of open files&quot;) },
         { &quot;System.Hostname&quot;, H_HostName, NULL, DCI_DT_STRING, DCIDESC_SYSTEM_HOSTNAME },
         { &quot;System.Memory.Physical.Free&quot;, H_MemoryInfo, (char *)MEMINFO_PHYSICAL_FREE, DCI_DT_UINT64, DCIDESC_SYSTEM_MEMORY_PHYSICAL_FREE },
         { &quot;System.Memory.Physical.Total&quot;, H_MemoryInfo, (char *)MEMINFO_PHYSICAL_TOTAL, DCI_DT_UINT64, DCIDESC_SYSTEM_MEMORY_PHYSICAL_TOTAL },

Modified: trunk/src/libnetxms/Makefile.nw
===================================================================
--- trunk/src/libnetxms/Makefile.nw 2008-07-04 07:27:33 UTC (rev 3365)
+++ trunk/src/libnetxms/Makefile.nw 2008-07-05 10:14:42 UTC (rev 3366)
@@ -5,10 +5,10 @@
 
 include ../../netware/Makefile.inc
 
-OBJECTS = c_lgcc3.o config.o crypto.o gen_uuid.o dload.o hash.o icmp.o \
- inline.o main.o md5.o message.o msgwq.o nxcp.o qsort.o queue.o \
- sha1.o string.o strmap.o table.o \
- tools.o unicode.o uuid.o
+OBJECTS = base64.o c_lgcc3.o config.o crypto.o gen_uuid.o dload.o hash.o \
+ icmp.o inline.o main.o md5.o message.o msgwq.o nxcp.o qsort.o \
+ queue.o sha1.o string.o strmap.o table.o \
+ tools.o unicode.o uuid.o xml.o
 EXEC = netxms.nlm
 DEF = netxms.def
 OBJTMP = netxms_r.o
Received on Sat Jul 05 2008 - 13:14:42 EEST

This archive was generated by hypermail 2.2.0 : Sat Jul 05 2008 - 13:09:10 EEST