{"id":18497700,"url":"https://github.com/centreon/centreon-nsclient-build","last_synced_at":"2025-06-10T19:08:02.211Z","repository":{"id":37825108,"uuid":"64322689","full_name":"centreon/centreon-nsclient-build","owner":"centreon","description":"Source use to build the centreon NSClient agent","archived":false,"fork":false,"pushed_at":"2024-10-01T14:37:34.000Z","size":538584,"stargazers_count":19,"open_issues_count":4,"forks_count":3,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-12-25T17:42:18.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"NSIS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centreon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-27T16:03:52.000Z","updated_at":"2024-10-01T14:38:17.000Z","dependencies_parsed_at":"2024-09-17T12:03:22.386Z","dependency_job_id":"4cb6be67-b600-4650-a961-5004ab96630c","html_url":"https://github.com/centreon/centreon-nsclient-build","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fcentreon-nsclient-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fcentreon-nsclient-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fcentreon-nsclient-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fcentreon-nsclient-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centreon","download_url":"https://codeload.github.com/centreon/centreon-nsclient-build/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239213758,"owners_count":19601035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:35:25.048Z","updated_at":"2025-02-17T00:21:00.273Z","avatar_url":"https://github.com/centreon.png","language":"NSIS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# centreon-nsclient-build\n\n## Overview \n\nYou can find here all sources and scripts to build your own version of the centreon-nsclient agent. That's very useful when you want to create your own centreon_plugins.exe or customize nsclient.ini content (e.g allowed hosts values, specific command handler, etc.).\n\nPull request are disabled as Centreon teams manage the upgrade to the newer version of centreon-plugins and NSClient++. If you want to provide some feedback, ask for a new plugin to be included in the build routine, just open an issue to discuss about it. \n\nThis repository is being built using a Travis-ci free plan. You can get latest build artefacts here: https://github.com/centreon/centreon-nsclient-build/releases. \n\n## Prerequisites\n\nTo use this repo, you must have:\n\n* a Windows Server 2K8 or above, with a x64 architecture\n* a 64bits version of Strawberry perl (http://strawberryperl.com/). The build env is tested with the version below: \n\nThen you'll have to add `C:\\Strawberry` to your **PATH** to be able to run the following commands.\n\n```\nperl -v\n\nThis is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x64-multi-thread\n\nCopyright 1987-2017, Larry Wall\n\nPerl may be copied only under the terms of either the Artistic License or the\nGNU General Public License, which may be found in the Perl 5 source kit.\n\nComplete documentation for Perl, including FAQ lists, should be found on\nthis system using \"man perl\" or \"perldoc perl\".  If you have access to the\nInternet, point your browser at http://www.perl.org/, the Perl Home Page.\n```\n\n* Some additionnal perl libs must be installed\n\n```\ncpan install PAR::Packer PAR::Packer Authen::NTLM Date::Manip Email::Send::SMTP::Gmail HTTP::ProxyPAC IO::Socket::SSL JE JSON::XS Net::FTPSSL Net::NTP Net::SSLeay Pod::Simple::Search Tie::RefHash::Weak Win32::Job XML::LibXML::SAX Win32::NetResource\n```\n\n## How to use it\n\n### Quick tour of the files that matter\n\nThere are a lot of files in this repository, but you just have to know a few to build your own centreon-nsclient flavour.\n\n#### build\\_centreon\\_plugins\\_64.bat\n\nThis file allows you to generate a `centreon_plugins.exe` executable binary to be executed on a 64 bits Windows OS. You can bring your own modifications to the following lines if needed:\n\n- `SET VERSION_PLUGIN=20000101`           # set the version of centreon-plugins, we recommend to follow official centreon_plugins releases (https://github.com/centreon/centreon-plugins/releases)\n- `set PERL_INSTALL_DIR=C:\\Strawberry`    # set the path to your Strawberry perl installation dir \n\nIf you want to add more plugins, its associated modes and dependencies, you can modify the `CMD /C %PERL_INSTALL_DIR%\\perl\\site\\bin\\pp --lib=centreon-plugins\\ ^` command line parameters. Only modify by adding of removing lines starting by `-M`. An extract below shows how we add our WSUS plugin to the `centreon_plugins.exe` binary:\n\n```\n-M apps::wsus::local::plugin ^\n-M apps::wsus::local::mode::computersstatus ^\n-M apps::wsus::local::mode::updatesstatus ^\n-M apps::wsus::local::mode::synchronisationstatus ^\n-M apps::wsus::local::mode::serverstatistics ^\n```\n\nThen, to rebuild the installer with the previously built resources, just run:\n\n```\nbuild_centreon_plugins_64.bat\n```\n\n#### build\\_check_logfiles\\_64.bat\n\nRun this script to build the last tested version of [ConSol Labs'](https://labs.consol.de) [check_logfiles](https://github.com/lausser/check_logfiles).\n\n```\nbuild_check_logfiles_64.bat\n```\n\n#### builddef-x64.nsi\n\nNullSoft Install Script system file. It will allow you to define some properties of your installer.\n\nThe three lines you may want to modify are:\n\n```\n!define PRODUCT_VERSION \"0.5.2.41\"                # Set the NSClient++ version, in this repository we are using 0.5.2.41, do not modify unless you know what you're doing\n\n!define PACKAGE_VERSION \"20000101\"                # Set the release version, once again it's easier to stick to the official centreon-plugins release\n\n!define MSI_NSCLIENT \"NSCP-0.5.2.41-Win32.msi\"    # If you modified the PRODUCT version, you may want to also tune this line to reflect the associated MSI\n```\n\n#### resources/nsclient.ini\n\nThis is your NSClient++ main config file, just modify it. A full documentation on available directives is avalaible from NSClient++ official website (https://docs.nsclient.org/tutorial/#default-settings).\n\n\n### Building NSCLient++ agent with centreon_plugins.exe\n\nHere are the step to take to build a NSClient agent: \n\n#### Clone repositories\n\n```\ngit clone https://github.com/centreon/centreon-nsclient-build\n```\n\n* (optionnal) Update its submodule (centreon-plugins) \n\n:warning: Be warned that you might use some code from centreon-plugins master (=\u003e unstable or wip code). If this is not what you want, just go to the next step.\n\n```\ncd centreon-nsclient-build\ngit submodule update --init\n```\n\n#### build the 64bits plugin version\n\n```\nC:\\Your\\path\\to\\localrepo\\centreon-nsclient\u003e build_centreon_plugins_64.bat\n```\n\nSuccessful build output is like: \n\n```\n        1 file(s) copied.\n        1 file(s) copied.\nGenerating a gmake-style Makefile\nWriting Makefile for myldr\nMakefile:1080: warning: overriding recipe for target '.c.o'\nMakefile:358: warning: ignoring old recipe for target '.c.o'\ngcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DU\n:\\STRAWB~1\\perl\\lib\\CORE\"  -DLDLIBPTHNAME=\\\"\\\" -DPARL_EXE=\\\"parl.exe\\\" -DPAR_PACKER_VERSION=\\\"1.039\\\" -s -O2 main.c\nwindres -i winres/pp.rc -o ppresource.coff --input-format=rc --output-format=coff --target=pe-x86-64\ng++ main.o ppresource.coff -s   -s -L\"C:\\STRAWB~1\\perl\\lib\\CORE\" -L\"C:\\STRAWB~1\\c\\lib\"  \"C:\\STRAWB~1\\perl\\lib\\CORE\\libperl526.a\" \"C:\\STRAWB~1\n_64-w64-mingw32\\lib\\libkernel32.a\" \"C:\\STRAWB~1\\c\\x86_64-w64-mingw32\\lib\\libuser32.a\" \"C:\\STRAWB~1\\c\\x86_64-w64-mingw32\\lib\\libgdi32.a\" \"C:\\S\n[...]\n[...]\n[...]\nPacking \"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2\\par-41646d696e6973747261746f72\\cache-d9b6915b270bf0e6ae3204863f4f7c4a02de9245/f3a0f67d.dll\"...\nWritten as \"auto/File/Glob/Glob.xs.dll\"\nPress any key to continue . . .\n\nC:\\Your\\path\\to\\localrepo\\centreon-nsclient\u003e\n```\n\nIf it succeed, you must be able to see a centreon_plugins.exe in resources\\scripts\\x64 directory.\n\n#### Build Centreon-NSCLient++ agent\n\n```C:\\Users\\Administrator\\Desktop\\centreon-Agent-NSclient\u003ebuild_centreon_nsclient.bat```\n\nThe process produces an output similar to: \n\n```\nresources\\scripts\\Win32\\centreon\\centreon_plugins.exe\nresources\\scripts\\Win32\\centreon\\check_logfiles.exe\n2 File(s) copied\n        1 file(s) copied.\n        1 file(s) copied.\n\n7-Zip (a) [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\n\nScanning the drive:\n2 folders, 4 files, 31971949 bytes (31 MiB)\n\nCreating archive: ..\\resources\\resources.zip\n\nItems to compress: 6\n\n\nFiles read from disk: 4\nArchive size: 20661229 bytes (20 MiB)\nEverything is Ok\n----------------------------------------------------------------------\nNSIS String Functions Header File 1.09 - Copyright 2004 Diego Pedroso\n----------------------------------------------------------------------\n (C:\\Users\\Administrator\\Desktop\\centreon-Agent-NSclient\\bin\\nsis\\Include\\StrFunc.nsh:52)\n$ {StrStrAdv} - Copyright 2003-2004 Diego Pedroso (macro:STRFUNC_FUNC:11)\n$ {UnStrStrAdv} - Copyright 2003-2004 Diego Pedroso (macro:STRFUNC_FUNC:5)\n$ {StrStrAdv} \"$9\" \"$1\" \"{\" \"\u003c\" \"\u003e\" \"0\" \"0\" \"0\" (macro:FUNCTION_STRING_StrStrAdv_Call:3)\n$ {StrStrAdv} \"$9\" \"$UninstallNSClientID\" \"}\" \"\u003c\" \"\u003c\" \"0\" \"0\" \"0\" (macro:FUNCTION_STRING_StrStrAdv_Call:3)\n$ {UnStrStrAdv} \"$9\" \"$1\" \"{\" \"\u003c\" \"\u003e\" \"0\" \"0\" \"0\" (macro:FUNCTION_STRING_UnStrStrAdv_Call:3)\n$ {UnStrStrAdv} \"$9\" \"$UninstallNSClientID\" \"}\" \"\u003c\" \"\u003c\" \"0\" \"0\" \"0\" (macro:FUNCTION_STRING_UnStrStrAdv_Call:3)\nPress any key to continue . . .\n\nC:\\Your\\path\\to\\localrepo\\centreon-nsclient\u003e\n```\n\nOutput of this build routine is two binaries: Centreon-NSClient-0.5.2.41-20000101-Win32.exe Centreon-NSClient-0.5.2.41-20000101-x64.exe\n\n## Installation \n\nYou can install the agent with a double-click on: Centreon-NSClient-0.5.2.41-20000101-Win32.exe or Centreon-NSClient-0.5.2.41-20000101-x64.exe. \n\nNote that you can use the following flags parameters of the .exe execution: \n\n    - /S : Silently installation\n    - /nouninstall : no uninstall of the current package if it was already installed\n\nNow, it's deployment time :) Enjoy ! \n\n## Plugin actually available with the centreon-plugins.exe binary \n\nTo know which plugins are available in centreon-plugins.exe, use the following command: \n\n`/path/to/centreon_plugins.exe --list-plugin\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentreon%2Fcentreon-nsclient-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentreon%2Fcentreon-nsclient-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentreon%2Fcentreon-nsclient-build/lists"}