Changeset 1fc246c in nscp


Ignore:
Timestamp:
09/22/09 21:16:37 (4 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
55e44d4
Parents:
e7dbac9
Message:

SOme minor fixes to the installer and added archive project

Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • AutoBuild.h

    re7dbac9 r1fc246c  
    33// change the FALSE to TRUE for autoincrement of build number 
    44#define INCREMENT_VERSION TRUE 
    5 #define FILEVER        0,3,7,279 
    6 #define PRODUCTVER     0,3,7,279 
    7 #define STRFILEVER     _T("0.3.7.279") 
    8 #define STRPRODUCTVER  _T("0.3.7.279") 
    9 #define STRPRODUCTDATE  _T("2009-09-06") 
     5#define FILEVER        0,3,7,347 
     6#define PRODUCTVER     0,3,7,347 
     7#define STRFILEVER     _T("0.3.7.347") 
     8#define STRPRODUCTVER  _T("0.3.7.347") 
     9#define STRPRODUCTDATE  _T("2009-09-20") 
    1010#endif // AUTOBUILD_H 
  • Jamroot

    r308b6f5 r1fc246c  
    3030local target-config = nsc.ini ; 
    3131local target-readme = readme.txt ; 
     32local target-guide = "Nagios Usage Guide.pdf" ; 
     33local target-refman = "NSClient++ Reference Manual.pdf" ; 
    3234local target-changelog = changelog.txt ; 
    3335local target-license = license.txt ; 
     
    150152explicit $(target-config) ; 
    151153 
    152 make $(target-readme) : files/readme.txt : common.copy ; 
     154make $(target-readme) : docs/readme.txt : common.copy ; 
    153155explicit $(target-readme) ; 
     156make $(target-guide) : "docs/Nagios Usage Guide.pdf" : common.copy ; 
     157explicit $(target-guide) ; 
     158make $(target-refman) : "docs/NSClient++ Reference Manual.pdf" : common.copy ; 
     159explicit $(target-refman) ; 
    154160 
    155161make $(target-license) : files/license.txt : common.copy ; 
     
    262268explicit all-scripts-targets ; 
    263269 
    264 alias all-root-targets : $(target) $(target-config) $(target-readme) $(target-license) $(target-changelog) $(target-counters) helpers/systray_helper ; 
     270alias all-root-targets : $(target) $(target-config) $(target-readme) $(target-guide) $(target-refman) $(target-license) $(target-changelog) $(target-counters) helpers/systray_helper ; 
    265271explicit all-root-targets ; 
    266272 
  • NSC.dist

    r358cda1 r1fc246c  
    276276;host_check=check_ok 
    277277 
    278 [NRPE Handlers] 
    279 ;# COMMAND DEFINITIONS 
    280 ;# Command definitions that this daemon will run. 
    281 ;# Can be either NRPE syntax: 
    282 ;command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 
    283 ;# Or simplified syntax: 
    284 ;test=c:\test.bat foo $ARG1$ bar 
    285 ;check_disk1=/usr/local/nagios/libexec/check_disk -w 5 -c 10 
    286 ;# Or even loopback (inject) syntax (to run internal commands) 
    287 ;# This is a way to run "NSClient" commands and other internal module commands such as check eventlog etc. 
    288 ;check_cpu=inject checkCPU warn=80 crit=90 5 10 15 
    289 ;check_eventlog=inject CheckEventLog Application warn.require.eventType=error warn.require.eventType=warning critical.require.eventType=error critical.exclude.eventType=info truncate=1024 descriptions 
    290 ;check_disk_c=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M File:WIN=c:\ATI\*.* 
    291 ;# But be careful: 
    292 ; dont_check=inject dont_check This will "loop forever" so be careful with the inject command... 
    293 ;# Check some escapings... 
    294 ; check_escape=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M "File: foo \" WIN=c:\\WINDOWS\\*.*" 
    295 ;# Some real world samples 
    296 ;nrpe_cpu=inject checkCPU warn=80 crit=90 5 10 15 
    297 ;nrpe_ok=scripts\ok.bat 
    298 ;check_multi_line=scripts\multi_line.bat 
    299 ;# 
    300 ;# The sample scripts 
    301 ;# 
    302 ;check_long=scripts\long.bat 
    303 ;check_ok=scripts\ok.bat 
    304 ;check_nok=scripts\xlong.bat 
    305 ;check_vbs=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs 
    306  
    307278;# REMOTE NRPE PROXY COMMANDS 
    308279;  A list of commands that check other hosts. 
  • NSClient++-2005.sln

    r358cda1 r1fc246c  
    16961696    {743B2362-DF6A-4C28-A6C9-0F970D8E1B66}.Debug|Mixed Platforms.Build.0 = Debug|Win32 
    16971697    {743B2362-DF6A-4C28-A6C9-0F970D8E1B66}.Debug|Win32.ActiveCfg = Debug|Win32 
    1698     {743B2362-DF6A-4C28-A6C9-0F970D8E1B66}.Debug|Win32.Build.0 = Debug|Win32 
    16991698    {743B2362-DF6A-4C28-A6C9-0F970D8E1B66}.Debug|x64.ActiveCfg = Debug|x64 
    17001699    {743B2362-DF6A-4C28-A6C9-0F970D8E1B66}.Debug-MemCheck|Any CPU.ActiveCfg = Debug|Win32 
     
    17371736    {DF1DB6FB-0448-46D6-AE82-9901495E5F1A}.Debug|Mixed Platforms.Build.0 = Debug|x64 
    17381737    {DF1DB6FB-0448-46D6-AE82-9901495E5F1A}.Debug|Win32.ActiveCfg = Debug|Win32 
    1739     {DF1DB6FB-0448-46D6-AE82-9901495E5F1A}.Debug|Win32.Build.0 = Debug|Win32 
    17401738    {DF1DB6FB-0448-46D6-AE82-9901495E5F1A}.Debug|x64.ActiveCfg = Debug|x64 
    17411739    {DF1DB6FB-0448-46D6-AE82-9901495E5F1A}.Debug|x64.Build.0 = Debug|x64 
  • changelog

    re7dbac9 r1fc246c  
    66 * Fixa dependonservice LanManWorkStation (old win) 
    77 * Fix RtlStringFromGUID problem on NT4 
     8 
     92009-09-20 MickeM 
     10 * Fixed alias in CheckWMI (now works) 
     11 + Added columnSyntax to CheckWMI to allow formating of returned data (default is %column%=%value%) 
     12 + Added columnSeparator to CheckWMI to allow formating of returned data (default is ", ") 
     13 
     142009-09-13 MickeM 
     15 * Fixed some more issues with the installer should not "work" on Windows 2008 as well as slightly simpler to configure. 
    816 
    9172009-09-06 MickeM 
  • helpers/installer/Product.wxs

    r308b6f5 r1fc246c  
    9898                          IconIndex="0" Description="Start the $(var.App.Title) systemtray agent"/> 
    9999              </File> 
     100               
    100101              <File Id="NSClientINI" Name="NSC.ini" LongName="NSC.ini" DiskId="1" Source="$(var.Path.ini)/NSC.ini" Vital="yes"/> 
    101102              <?ifdef var.boost ?> 
     
    113114            <Component Id="FireWallException" Guid="F6636DB0-A0B9-4dA2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)" /> 
    114115            <Component Id="ServiceRegistration" Guid="F6636DB0-A0B9-4dA2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)" /> 
     116            <Component Id="Documentation" Guid="9B490E67-5472-4267-889C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     117              <File Id="doc.usage.nagios" Name="nagios.pdf" LongName="Nagios Usage Guide.pdf" DiskId="1" Source="$(var.Source)/Nagios Usage Guide.pdf" Vital="no" > 
     118                <Shortcut Id="Startmenu.doc.nagios" Directory="ProgramMenuDir" Name="nagios" 
     119                          LongName="Nagios Usage Guide" WorkingDirectory="INSTALLDIR" Description="Nagios Usage Guide"/> 
     120              </File> 
     121              <File Id="doc.reference" Name="nsclient.pdf" LongName="NSClient++ Reference Manual.pdf" DiskId="1" Source="$(var.Source)/NSClient++ Reference Manual.pdf" Vital="no" > 
     122                <Shortcut Id="Startmenu.doc.ref" Directory="ProgramMenuDir" Name="refman" 
     123                          LongName="NSClient++ Reference Manual" WorkingDirectory="INSTALLDIR" Description="NSClient++ Reference Manual"/> 
     124              </File> 
     125            </Component> 
    115126            <Directory Id="INSTALLLOCATION_MODS" Name="modules"> 
    116127              <Component Id="NRPEListener" Guid="5A0246F8-5167-45db-B246-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     
    170181        <Feature Id="ServiceRegistration" Title="Register service" Description="Register the NSClient++ service" Level="1"> 
    171182          <ComponentRef Id="ServiceRegistration" /> 
     183        </Feature> 
     184        <Feature Id="Documentation" Title="Documentation (pdf)" Description="Documentation for NSClient++ and how to use it from Nagios" Level="1"> 
     185          <ComponentRef Id="Documentation" /> 
    172186        </Feature> 
    173187        <Feature Id="Plugins" Title="Plugins" Description="Plugins" Level="1" Absent="disallow"> 
     
    232246    </CustomTable> 
    233247 
    234     <!-- 
    235     <Condition Message='This installation can only run in full UI mode.'> 
    236       UILevel = 5 
    237     </Condition> 
    238 --> 
    239     <Property Id='ARPCOMMENTS'>NSClient++ is a </Property> 
    240     <Property Id='ARPCONTACT'>michael@medin.name</Property> 
    241     <Property Id='ARPHELPLINK'>http://nsclient.org</Property> 
    242     <Property Id='ARPURLINFOABOUT'>http://nsclient.org</Property> 
    243     <Property Id='ARPURLUPDATEINFO'>http://nsclient.org</Property> 
    244     <Property Id='ARPHELPTELEPHONE'>http://nsclient.org</Property> 
    245     <Property Id='ARPPRODUCTICON'>nsclient.exe</Property> 
    246  
    247     <Property Id="CONF_CHECKS_DEFAULT"></Property> 
    248     <Property Id="CONF_NSCLIENT_DEFAULT"></Property> 
    249     <Property Id="CONF_NRPE_DEFAULT"></Property> 
    250     <Property Id="CONF_NSCA_DEFAULT"></Property> 
    251     <Property Id="CONF_WMI_DEFAULT"></Property> 
    252     <Property Id="ALLOW_CONFIGURATION" /> 
    253  
    254     <!-- CONFIGURE DEFAULT VALUES--> 
    255     <!-- 
    256     <Property Id="ALLOWED_HOSTS_DEFAULT">$$EMPTY$$</Property> 
    257     <Property Id="NSCLIENT_PWD_DEFAULT">$$EMPTY$$</Property> 
    258       --> 
    259  
    260     <!-- CONFIGURE THE INSTALLER --> 
    261     <Property Id='INSCON_CONFIGURE'>1</Property> 
    262     <Property Id='MAIN_CONFIGURATION_FILE'>NSC.ini</Property> 
    263     <Property Id='CUSTOM_CONFIGURATION_FILE'>NSC.ini</Property> 
    264  
    265     <Property Id='HELP_LINK'>http://nsclient.org/nscp/</Property> 
    266  
    267     <Property Id='SHOW_START_ON_EXIT'>1</Property> 
    268     <Property Id='START_SERVICE_ON_EXIT'></Property> 
    269     <Property Id='SHOW_DONATE_ON_EXIT'>1</Property> 
    270     <Property Id='DONATE_ON_EXIT'></Property> 
    271     <Property Id='KEEP_WHICH_CONFIG'>NEW</Property> 
    272     <!-- 
    273     <Property Id='MAIN_CONFIGURATION_FILE'>NSC.ini</Property> 
    274     --> 
    275     <!-- 
    276       <Property Id='ARPREADME'>path</Property>   
    277       <Property Id='ARPSIZE'>app size in kilobytes</Property> 
    278     --> 
     248    <?include properties.wxs ?> 
    279249 
    280250    <CustomAction Id='ReadOldConfig' BinaryKey='InstallerHelper' DllEntry='ImportConfig' Impersonate='no' /> 
    281     <CustomAction Id='ScheduleWriteConfig' BinaryKey='InstallerHelper' DllEntry='ScheduleWriteConfig' Impersonate='no' /> 
    282     <CustomAction Id="ExecWriteConfig" BinaryKey="InstallerHelper" DllEntry="ExecWriteConfig" Execute="deferred" Impersonate="no" Return="check"  /> 
     251    <CustomAction Id='ScheduleWriteConfig' BinaryKey='InstallerHelper' DllEntry='ScheduleWriteConfig' Impersonate='no' /> 
     252    <CustomAction Id="ExecWriteConfig" BinaryKey="InstallerHelper" DllEntry="ExecWriteConfig" Execute="deferred" Impersonate="no" Return="check"  /> 
    283253 
    284254    <CustomAction Id='NeedUninstall' BinaryKey='InstallerHelper' DllEntry='NeedUninstall' Impersonate='no' /> 
     
    311281      <RemoveExistingProducts After='InstallInitialize'/> 
    312282      <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWAPPFOUND</Custom> 
    313       <Custom Action="ScheduleWriteConfig" After='InstallFiles' /> 
    314       <Custom Action="SchedServiceInstall" After="InstallFiles" /> 
     283      <Custom Action="ScheduleWriteConfig" After='InstallFiles' /> 
     284      <Custom Action="SchedServiceInstall" After="InstallFiles" /> 
    315285      <Custom Action="SchedServiceUnInstall" Before="RemoveFiles" /> 
    316286      <Custom Action="StopAllServices" Before="InstallValidate" /> 
  • helpers/installer_dll/installer_helper.hpp

    re7dbac9 r1fc246c  
    450450    } 
    451451  } 
     452  bool is_installed(std::wstring wzComponentId) 
     453  { 
     454    INSTALLSTATE isInstalled = INSTALLSTATE_UNKNOWN; 
     455    INSTALLSTATE isAction = INSTALLSTATE_UNKNOWN; 
     456    UINT er = ::MsiGetComponentStateW(hInstall_, wzComponentId.c_str(), &isInstalled, &isAction); 
     457    if (ERROR_SUCCESS != er) { 
     458      logMessage(_T("State for : ") + wzComponentId + _T(" was unknown due to: ") + error::format::from_system(er)); 
     459      return WCA_TODO_UNKNOWN; 
     460    } 
     461    return (INSTALLSTATE_LOCAL == isInstalled || INSTALLSTATE_SOURCE == isInstalled); 
     462  } 
    452463  /******************************************************************** 
    453464  WcaIsInstalling() - determines if a pair of installstates means install 
  • helpers/installer_dll/main_dll.cpp

    r308b6f5 r1fc246c  
    491491 
    492492 
    493 //#pragma comment(linker, "/EXPORT:UninstallService=_UninstallService@4") 
    494 /* 
    495 extern "C" UINT __stdcall UninstallService (MSIHANDLE hInstall) { 
    496   msi_helper h(hInstall, _T("UninstallService")); 
    497   try { 
    498     h.logMessage(_T("Remove mode is: ") + h.getPropery(_T("REMOVE"))); 
    499     h.logMessage(_T("mime mode is: ") + h.getPropery(_T("REMOVE_MIME"))); 
    500     h.setProperty(_T("REMOVE_MIME"), _T("test")); 
    501  
    502     h.startProgress(10000, 2*10000, _T("Removing service: [2] ([1])..."), _T("Removing service: [2] ([1])... (X)")); 
    503     if (!uninstall(h)) 
    504       return ERROR_INSTALL_FAILURE; 
    505   } catch (installer_exception e) { 
    506     h.errorMessage(_T("Failed to install service: ") + e.what()); 
    507     return ERROR_INSTALL_FAILURE; 
    508   } catch (...) { 
    509     h.errorMessage(_T("Failed to install service: <UNKNOWN EXCEPTION>")); 
    510     return ERROR_INSTALL_FAILURE; 
    511   } 
    512   return ERROR_SUCCESS; 
    513 } 
    514 */ 
    515  
    516493//#pragma comment(linker, "/EXPORT:UpdateConfig=_UpdateConfig@4") 
    517494 
     
    534511        { 
    535512          std::wstring shortname = h.get_record_formatted_string(hRec, feqShortName); 
    536           h.logMessage(_T("Starting: ") + shortname); 
    537           if (!start(h, shortname)) { 
    538             h.logMessage(_T("service failed to start: ") + shortname); 
     513          std::wstring component = h.get_record_string(hRec, feqComponent); 
     514 
     515          // figure out what we're doing for this exception, treating reinstall the same as install 
     516          msi_helper::WCA_TODO todoComponent = h.get_component_todo(component); 
     517          if ((msi_helper::WCA_TODO_REINSTALL == todoComponent ? msi_helper::WCA_TODO_INSTALL : todoComponent) != msi_helper::WCA_TODO_INSTALL) { 
     518            h.logMessage(_T("Component '") + component + _T("' action state (") + strEx::itos(todoComponent) + _T(") doesn't match request (") + strEx::itos(msi_helper::WCA_TODO_INSTALL) + _T(")")); 
     519            hRec = h.fetch_record(hView); 
     520            continue; 
     521          } 
     522          try { 
     523            if (!serviceControll::isStarted(shortname)) { 
     524              h.updateProgress(_T("Starting service"), shortname); 
     525              serviceControll::Start(shortname); 
     526            } 
     527          } catch (const serviceControll::SCException& e) { 
     528            h.logMessage(_T("Failed to start service: ") + shortname + _T(": ") + e.error_); 
    539529          } 
    540530          hRec = h.fetch_record(hView); 
     
    547537      if (r > 32) 
    548538        return ERROR_SUCCESS; 
    549       msi_helper h(hInstall, _T("Donate")); 
    550       h.errorMessage(_T("Failed to start web browser...")); 
     539      h.errorMessage(_T("Failed to start web browser for donations...")); 
    551540      return ERROR_INSTALL_FAILURE; 
    552541    } 
    553542  } catch (installer_exception e) { 
    554     h.errorMessage(_T("Failed to start service: ") + e.what()); 
    555     return ERROR_INSTALL_FAILURE; 
    556   } catch (...) { 
    557     h.errorMessage(_T("Failed to start service: <UNKNOWN EXCEPTION>")); 
     543    h.errorMessage(_T("Failed to process finalizing stuff: ") + e.what()); 
     544    return ERROR_INSTALL_FAILURE; 
     545  } catch (...) { 
     546    h.errorMessage(_T("Failed to process finalizing stuff: <UNKNOWN EXCEPTION>")); 
    558547    return ERROR_INSTALL_FAILURE; 
    559548  } 
     
    584573    { 
    585574      std::wstring shortname = h.get_record_formatted_string(hRec, feqShortName); 
    586       h.logMessage(_T("Stopping: ") + shortname); 
    587       if (!stop(h, shortname)) { 
    588         h.logMessage(_T("service failed to stop: ") + shortname); 
     575      std::wstring component = h.get_record_string(hRec, feqComponent); 
     576 
     577      // figure out what we're doing for this exception, treating reinstall the same as install 
     578      msi_helper::WCA_TODO todoComponent = h.get_component_todo(component); 
     579      if (todoComponent == msi_helper::WCA_TODO_REINSTALL) 
     580        todoComponent = msi_helper::WCA_TODO_INSTALL; 
     581      h.logMessage(_T("Component '") + component + _T("' action state (") + strEx::itos(todoComponent)); 
     582      if (todoComponent != msi_helper::WCA_TODO_INSTALL && todoComponent != msi_helper::WCA_TODO_UNINSTALL) { 
     583        h.logMessage(_T("Component '") + component + _T("' action state (") + strEx::itos(todoComponent) + _T(") doesn't match request (IN/UN/RE)")); 
     584        hRec = h.fetch_record(hView); 
     585        continue; 
     586      } 
     587      try { 
     588        if (serviceControll::isStarted(shortname)) { 
     589          h.updateProgress(_T("Stopping service"), shortname); 
     590          serviceControll::Stop(shortname); 
     591        } 
     592      } catch (const serviceControll::SCException& e) { 
     593        h.logMessage(_T("Failed to stop service: ") + shortname + _T(": ") + e.error_); 
    589594      } 
    590595      hRec = h.fetch_record(hView); 
    591596    } 
    592     /* 
    593     val = h.getPropery(_T("DONATE_ON_EXIT")); 
    594     if (val == _T("1")) { 
    595     long r = (long)ShellExecute(NULL, _T("open"), _T("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=michael@medin.name&item_name=Fans+of+NSClient%2B%2B&item_number=Installer+Campaign&amount=10%2e00&currency_code=EUR&return=http%3A//nsclient.org"), NULL, NULL, SW_SHOWNORMAL); 
    596     if (r > 32) 
    597     return ERROR_SUCCESS; 
    598     msi_helper h(hInstall, _T("Donate")); 
    599     h.errorMessage(_T("Failed to start web browser...")); 
    600     return ERROR_INSTALL_FAILURE; 
    601     } 
    602     */ 
    603   } catch (installer_exception e) { 
    604     h.errorMessage(_T("Failed to start service: ") + e.what()); 
    605     return ERROR_INSTALL_FAILURE; 
    606   } catch (...) { 
    607     h.errorMessage(_T("Failed to start service: <UNKNOWN EXCEPTION>")); 
     597  } catch (installer_exception e) { 
     598    h.errorMessage(_T("Failed to stop service: ") + e.what()); 
     599    return ERROR_INSTALL_FAILURE; 
     600  } catch (...) { 
     601    h.errorMessage(_T("Failed to stop service: <UNKNOWN EXCEPTION>")); 
    608602    return ERROR_INSTALL_FAILURE; 
    609603  } 
  • include/strEx.h

    rdcd5462 r1fc246c  
    6565  } 
    6666 
    67   inline void append_list(std::wstring &lst, std::wstring &append) { 
     67  inline void append_list(std::wstring &lst, std::wstring &append, std::wstring sep = _T(", ")) { 
     68    if (append.empty()) 
     69      return; 
    6870    if (!lst.empty()) 
    69       lst += _T(", "); 
     71      lst += sep; 
    7072    lst += append; 
    7173  } 
  • modules/CheckWMI/CheckWMI.cpp

    r3692371 r1fc246c  
    9494  std::wstring ns = _T("root\\cimv2"); 
    9595  bool bPerfData = true; 
     96  std::wstring colSyntax; 
     97  std::wstring colSep; 
    9698 
    9799  WMIContainer result_query; 
     
    101103    MAP_OPTIONS_STR2INT(_T("truncate"), truncate) 
    102104    MAP_OPTIONS_STR(_T("namespace"), ns) 
    103     MAP_OPTIONS_STR(_T("Alias"), alias) 
     105    MAP_OPTIONS_STR(_T("Alias"), result_query.alias) 
    104106    MAP_OPTIONS_BOOL_FALSE(IGNORE_PERFDATA, bPerfData) 
    105107    MAP_OPTIONS_NUMERIC_ALL(result_query, _T("")) 
    106108    MAP_OPTIONS_SHOWALL(result_query) 
    107109    MAP_CHAINED_FILTER(_T("string"),string) 
     110    MAP_OPTIONS_STR(_T("columnSyntax"),colSyntax) 
     111    MAP_OPTIONS_STR(_T("columnSeparator"),colSep) 
    108112    MAP_CHAINED_FILTER(_T("numeric"),numeric) 
    109113    MAP_OPTIONS_SECONDARY_BEGIN(_T(":"), p2) 
     
    112116      else if (p2.first == _T("Query")) { 
    113117          query = p__.second; 
    114           alias = p2.second; 
     118          result_query.alias = p2.second; 
    115119        } 
    116120    MAP_OPTIONS_MISSING_EX(p2, message, _T("Unknown argument: ")) 
     
    135139    NSC_DEBUG_MSG_STD(_T("No filters specified so we will match all rows")); 
    136140    hit_count = rows.size(); 
     141    for (WMIQuery::result_type::iterator citRow = rows.begin(); citRow != rows.end(); ++citRow) { 
     142      WMIQuery::wmi_row vals = *citRow; 
     143      strEx::append_list(message, vals.render(colSyntax, colSep), colSep); 
     144    } 
    137145  } else { 
    138146    bool match = chain.get_inital_state(); 
     
    141149      match = chain.match(match, vals); 
    142150      if (match) { 
    143         strEx::append_list(message, vals.render()); 
     151        strEx::append_list(message, vals.render(colSyntax, colSep), colSep); 
    144152        hit_count++; 
    145153      } 
     
    149157  if (!bPerfData) 
    150158    result_query.perfData = false; 
     159  if (result_query.alias.empty()) 
     160    result_query.alias = _T("wmi query"); 
     161 
     162  NSC_DEBUG_MSG_STD(_T("Message is: ") + message); 
    151163  result_query.runCheck(hit_count, returnCode, message, perf); 
    152164  if ((truncate > 0) && (message.length() > (truncate-4))) 
  • modules/CheckWMI/WMIQuery.cpp

    r7221dc8 r1fc246c  
    9393          } else if (vValue.vt == VT_I4) { 
    9494            value.setNumeric(column, vValue.lVal); 
     95          } else if (vValue.vt == VT_UI1) { 
     96            value.setNumeric(column, vValue.uintVal); 
    9597          } else if (vValue.vt == VT_UINT) { 
    9698            value.setNumeric(column, vValue.uintVal); 
  • modules/CheckWMI/WMIQuery.h

    r7221dc8 r1fc246c  
    134134    } 
    135135 
    136     std::wstring render() { 
     136    std::wstring render(std::wstring syntax = _T(""), std::wstring sep = _T(", ")) { 
    137137      std::wstring ret; 
    138138      for (list_type::const_iterator it = results.begin(); it != results.end(); ++it) { 
    139         if (!ret.empty()) ret += _T(", "); 
    140         ret += (*it).first + _T("=") + (*it).second.string; 
     139        if (syntax.empty()) { 
     140          if (!ret.empty()) ret += sep; 
     141          ret += (*it).first + _T("=") + (*it).second.string; 
     142        } else { 
     143          std::wstring sub = syntax; 
     144          strEx::replace(sub, _T("%column%"), (*it).first); 
     145          strEx::replace(sub, _T("%value%"), (*it).second.string); 
     146          strEx::replace(sub, _T("%") + (*it).first + _T("%"), (*it).second.string); 
     147          if (sub == syntax) 
     148            continue; 
     149          strEx::append_list(ret, sub, sep); 
     150        } 
    141151      } 
    142152      return ret; 
  • modules/LUAScript/LUAScript-2005.vcproj

    r3692371 r1fc246c  
    4848        Name="VCCLCompilerTool" 
    4949        Optimization="0" 
    50         AdditionalIncludeDirectories="../include;../../include" 
     50        AdditionalIncludeDirectories="&quot;D:\source\NSCP-stable\lib-source\LUA\src\lua-5.1.2\src\&quot;;../include;../../include" 
    5151        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;" 
    5252        MinimalRebuild="true" 
Note: See TracChangeset for help on using the changeset viewer.