"Fossies" - the Fresh Open Source Software Archive

Member "netxms-3.4.232/src/agent/subagents/aix/aix_subagent.h" (6 Jul 2020, 3912 Bytes) of package /linux/misc/netxms-3.4.232.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "aix_subagent.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.3.350_vs_3.4.178.

    1 /*
    2 ** NetXMS subagent for AIX
    3 ** Copyright (C) 2005-2020 Victor Kirhenshtein
    4 **
    5 ** This program is free software; you can redistribute it and/or modify
    6 ** it under the terms of the GNU General Public License as published by
    7 ** the Free Software Foundation; either version 2 of the License, or
    8 ** (at your option) any later version.
    9 **
   10 ** This program is distributed in the hope that it will be useful,
   11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 ** GNU General Public License for more details.
   14 **
   15 ** You should have received a copy of the GNU General Public License
   16 ** along with this program; if not, write to the Free Software
   17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18 **
   19 ** File: aix_subagent.h
   20 **
   21 **/
   22 
   23 #ifndef _aix_subagent_h_
   24 #define _aix_subagent_h_
   25 
   26 #include <nms_common.h>
   27 #include <nms_agent.h>
   28 #include <nms_threads.h>
   29 #include <sys/var.h>
   30 #include "libperfstat_compat.h"
   31 
   32 #define AIX_DEBUG_TAG   _T("sa.aix")
   33 
   34 /**
   35  * CPU stats
   36  */
   37 enum 
   38 {
   39     CPU_USAGE_OVERALL,
   40     CPU_USAGE_USER,
   41     CPU_USAGE_SYSTEM,
   42     CPU_USAGE_IDLE,
   43     CPU_USAGE_IOWAIT,
   44     CPU_PA_OVERALL,
   45     CPU_PA_USER,
   46     CPU_PA_SYSTEM,
   47     CPU_PA_IDLE,
   48     CPU_PA_IOWAIT
   49 };
   50 
   51 enum
   52 {
   53     INTERVAL_1MIN,
   54     INTERVAL_5MIN,
   55     INTERVAL_15MIN,
   56 };
   57 
   58 #define MAKE_CPU_USAGE_PARAM(interval, source) (const TCHAR *)((((DWORD)(interval)) << 16) | ((DWORD)(source)))
   59 #define CPU_USAGE_PARAM_INTERVAL(p) ((CAST_FROM_POINTER((p), DWORD)) >> 16)
   60 #define CPU_USAGE_PARAM_SOURCE(p) ((CAST_FROM_POINTER((p), DWORD)) & 0x0000FFFF)
   61 
   62 /**
   63  * FIle system info types
   64  */
   65 enum
   66 {
   67     FS_AVAIL,
   68     FS_AVAIL_INODES,
   69     FS_AVAIL_INODES_PERC,
   70     FS_AVAIL_PERC,
   71     FS_FREE,
   72     FS_FREE_INODES,
   73     FS_FREE_INODES_PERC,
   74     FS_FREE_PERC,
   75     FS_FSTYPE,
   76     FS_TOTAL,
   77     FS_TOTAL_INODES,
   78     FS_USED,
   79     FS_USED_INODES,
   80     FS_USED_INODES_PERC,
   81     FS_USED_PERC
   82 };
   83 
   84 /**
   85  * LVM info types
   86  */
   87 enum
   88 {
   89     LVM_LV_SIZE,
   90     LVM_LV_STATUS,
   91     LVM_PV_FREE,
   92     LVM_PV_FREE_PERC,
   93     LVM_PV_RESYNC,
   94     LVM_PV_STALE,
   95     LVM_PV_STATUS,
   96     LVM_PV_TOTAL,
   97     LVM_PV_USED,
   98     LVM_PV_USED_PERC,
   99     LVM_VG_FREE,
  100     LVM_VG_FREE_PERC,
  101     LVM_VG_LVOL_TOTAL,
  102     LVM_VG_PVOL_ACTIVE,
  103     LVM_VG_PVOL_TOTAL,
  104     LVM_VG_RESYNC,
  105     LVM_VG_STALE,
  106     LVM_VG_STATUS,
  107     LVM_VG_TOTAL,
  108     LVM_VG_USED,
  109     LVM_VG_USED_PERC
  110 };
  111 
  112 /**
  113  * Request types for H_MemoryInfo
  114  */
  115 enum
  116 {
  117     MEMINFO_PHYSICAL_AVAILABLE,
  118     MEMINFO_PHYSICAL_AVAILABLE_PERC,
  119     MEMINFO_PHYSICAL_CACHED,
  120     MEMINFO_PHYSICAL_CACHED_PERC,
  121     MEMINFO_PHYSICAL_FREE,
  122     MEMINFO_PHYSICAL_FREE_PERC,
  123     MEMINFO_PHYSICAL_TOTAL,
  124     MEMINFO_PHYSICAL_USED,
  125     MEMINFO_PHYSICAL_USED_PERC,
  126     MEMINFO_SWAP_FREE,
  127     MEMINFO_SWAP_FREE_PERC,
  128     MEMINFO_SWAP_TOTAL,
  129     MEMINFO_SWAP_USED,
  130     MEMINFO_SWAP_USED_PERC,
  131     MEMINFO_VIRTUAL_ACTIVE,
  132     MEMINFO_VIRTUAL_ACTIVE_PERC,
  133     MEMINFO_VIRTUAL_FREE,
  134     MEMINFO_VIRTUAL_FREE_PERC,
  135     MEMINFO_VIRTUAL_TOTAL,
  136     MEMINFO_VIRTUAL_USED,
  137     MEMINFO_VIRTUAL_USED_PERC
  138 };
  139 
  140 /**
  141  * Types for Process.XXX() parameters
  142  */
  143 enum
  144 {
  145     PROCINFO_CPUTIME,
  146     PROCINFO_IO_READ_B,
  147     PROCINFO_IO_READ_OP,
  148     PROCINFO_IO_WRITE_B,
  149     PROCINFO_IO_WRITE_OP,
  150     PROCINFO_KTIME,
  151     PROCINFO_PF,
  152     PROCINFO_UTIME,
  153     PROCINFO_VMSIZE,
  154     PROCINFO_WKSET,
  155     PROCINFO_THREADS
  156 };
  157 
  158 /**
  159  * I/O stats request types
  160  */
  161 enum
  162 {
  163     IOSTAT_NUM_READS,
  164     IOSTAT_NUM_WRITES,
  165     IOSTAT_NUM_RBYTES,
  166     IOSTAT_NUM_WBYTES,
  167     IOSTAT_IO_TIME,
  168     IOSTAT_QUEUE,
  169     IOSTAT_NUM_XFERS,
  170     IOSTAT_WAIT_TIME
  171 };
  172 
  173 /**
  174  * Network interface request types
  175  */
  176 enum
  177 {
  178     IF_INFO_ADMIN_STATUS,
  179     IF_INFO_OPER_STATUS,
  180     IF_INFO_BYTES_IN,
  181     IF_INFO_BYTES_OUT,
  182     IF_INFO_DESCRIPTION,
  183     IF_INFO_IN_ERRORS,
  184     IF_INFO_OUT_ERRORS,
  185     IF_INFO_PACKETS_IN,
  186     IF_INFO_PACKETS_OUT,
  187     IF_INFO_SPEED,
  188     IF_INFO_MTU
  189 };
  190 
  191 /**
  192  * Process list entry structure
  193  */
  194 typedef struct t_ProcEnt
  195 {
  196     unsigned int nPid;
  197     char szProcName[128];
  198 } PROC_ENT;
  199 
  200 // Functions
  201 void StartCpuUsageCollector();
  202 void ShutdownCpuUsageCollector();
  203 
  204 void StartIOStatCollector();
  205 void ShutdownIOStatCollector();
  206 
  207 void ClearLvmData();
  208 
  209 void ClearNetworkData();
  210 
  211 // Global variables
  212 extern BOOL g_bShutdown;
  213 
  214 #endif