{"id":43406390,"url":"https://github.com/aditosoftware/nodejs-icinga2api","last_synced_at":"2026-02-02T15:59:49.347Z","repository":{"id":57270860,"uuid":"86461229","full_name":"aditosoftware/nodejs-icinga2api","owner":"aditosoftware","description":"Nodejs module for Icinga2 Api","archived":false,"fork":false,"pushed_at":"2019-06-11T07:56:44.000Z","size":19,"stargazers_count":6,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-24T15:35:20.291Z","etag":null,"topics":["api","icinga2","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aditosoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-28T13:07:09.000Z","updated_at":"2024-05-06T19:33:44.000Z","dependencies_parsed_at":"2022-09-06T21:52:51.255Z","dependency_job_id":null,"html_url":"https://github.com/aditosoftware/nodejs-icinga2api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aditosoftware/nodejs-icinga2api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditosoftware%2Fnodejs-icinga2api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditosoftware%2Fnodejs-icinga2api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditosoftware%2Fnodejs-icinga2api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditosoftware%2Fnodejs-icinga2api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aditosoftware","download_url":"https://codeload.github.com/aditosoftware/nodejs-icinga2api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditosoftware%2Fnodejs-icinga2api/sbom","scorecard":{"id":166616,"data":{"date":"2025-08-11","repo":{"name":"github.com/aditosoftware/nodejs-icinga2api","commit":"1b5033200abce43710a222d34673dc3e49a24048"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/24 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T15:06:03.482Z","repository_id":57270860,"created_at":"2025-08-16T15:06:03.482Z","updated_at":"2025-08-16T15:06:03.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29015064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T14:58:54.169Z","status":"ssl_error","status_checked_at":"2026-02-02T14:58:51.285Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","icinga2","nodejs"],"created_at":"2026-02-02T15:59:48.599Z","updated_at":"2026-02-02T15:59:49.334Z","avatar_url":"https://github.com/aditosoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icinga2\nIcinga2 Remote api module. You can create, remove, update, etc of icinga2 objects\n\n[Icinga2 api doc](https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/icinga2-api)\n\n## Installation\n\n    npm install icinga2-api\n    \n### Getting started\nExample\n\n1. Check if the host \"4demo\" exist in monitoring.\n2. If not, create host \"4demo\".\n\n## Updated\nThe parameters 'group' and 'onServer' was removed from methode 'createHost' and 'createService'\n\n``` js\nconst icingaapi = require('icinga2-api');\n\nvar icingaServer = new icingaapi(\"icingas2server.local\", \"5665\", \"apiUser\", \"apiUserPass\");\n    icingaServer.getHostState(\"4demo\", function (err, result) {\n        if (err) {\n            if (err.Statuscode == \"404\") {\n                console.log(\"Host 4demo on monitoring was not found, create one\");\n                \n                // Create a host on icinga2.\n                icingaServer.createHost(\"passive-host\", \"4demo\", \"4Demo Server\", function (err, result) {\n                    if (err) {\n                        console.error(err);\n                    } else {\n                        console.log(\"Host 4demo was created successfull\");\n                    }\n                });\n            }\n            console.error(err);\n        } else {\n            console.log(result);\n        }\n    })\n```\n## Methods\n - getServices = function (callback)\n - getService = function (ServerName, ServiceName, callback)\n - getHosts = function (callback)\n - getHost = function (ServerName, callback)\n - getHostFiltered = function (filter, callback)\n - getServiceFiltered = function(filter, callback)\n   * filter = \n      ```js\n        {\n            \"filter\": \"service.vars.Backup_Server == servicename\",\n            \"filter_vars\": {\n                \"servicename\": \"backupServer\"\n            }\n        }\n      ```\n - getServiceWithState = function (state, callback)\n    * state = 0/1/2\n - createHost = function (template, host, displayname, callback)\n    * template - icinga2 host-template\n    * onServer = \"dockerHost\", set a custom variable in icinga2\n - createService = function (template, host, service, displayname, callback)\n - createServiceCustom = function (serviceObj, host, service, callback)\n    * serviceObj = \n        ```js\n        var serviceObj = JSON.stringify({\n            \"templates\": [\"passive-service\"],\n            \"attrs\": {\n                \"display_name\": \"Service Top\",\n                \"vars.group\": \"adito\",\n                \"vars.server\": \"dockerdmz\"\n            }\n        })\n        ```\n - createHostCustom = function (hostObj, host, callback)\n    * hostObj\n        ```js\n        var hostBody = JSON.stringify({\n            \"templates\": [\"passive-host\"],\n            \"attrs\": {\n                \"display_name\": \"4Demo Server\",\n                \"vars.group\": \"adito\",\n                \"vars.server\": \"dockerdmz\"\n            }\n        })\n        ```\n - createServiceCustom = function (serviceObj, host, service, callback)\n     * serviceObj\n        ```js\n        var serviceBody = JSON.stringify({\n            \"templates\": [\"passive-service\"],\n            \"attrs\": {\n                \"display_name\": \"Service on 4Demo Server\",\n            }\n        })\n - deleteHost = function (host, callback)\n - deleteService = function (service, host, callback)\n - setHostDowntime = function (dObj, hostname, callback)\n    * dObj (downtime object)\n        ```js\n            var dObj = {\n                'type': 'Host',\n                'start_time': actTime,\n                'end_time': endtime,\n                'author': 'icingaadmin',\n                'comment': \"Downtime for Backup\"\n            }\n        ```\n - setFilteredDowntime = function (dFilter, callback)\n    * dFilter (example: set downtime for all server where custom variable server = dockerhost)\n        ```js \n            var setDownTimeObject = {\n                'type': 'Host',\n                'start_time': actTime,\n                'end_time': endtime,\n                'author': 'icingaadmin',\n                'comment': \"Downtime for Backup\",\n                'filter': 'host.vars.server == server',\n                'filter_vars': {\n                    'server': \"dockerhost\"\n                }\n            }\n        ```\n - removeFilteredDowntime = function (dFilter, callback)\n    * dFilter(remove all Downtimes with autor \"icingaadmin\" and custom vars server \"dockerhost\"\n        ```js\n            var removeDownTimeObject = ({\n                \"type\": \"Downtime\",\n                \"filter\": \"downtime.author == filterAuthor \u0026\u0026 host.vars.server == filteredHost\",\n                \"filter_vars\": {\n                    \"filterAuthor\": \"icingaadmin\",\n                    \"filteredHost\": \"dockerhost\"\n                }\n            })\n        ```\n - disableHostNotification = function (hostname, callback)\n - setHostState = function (host, hostState, StateMessage, callback)\n - setServiceState = function (service, host, serviceState, serviceMessage, callback)\n - getHostState = function (hostName, callback)\n - getServiceTemplates = function(callback)\n - checkExistServiceTemplate = function(name, callback)\n - getHostTemplates = function(callback)\n - checkExistHostTemplate = function(name, callback)\n - setServicePerfdata = function (service, server, state, output, perfarr, callback)\n    * perfarr (Data array) - show process-check-result in [icinga2 api doc](https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/icinga2-api)\n        ```js\n            var perfdataArr = [\"Memory in %=\" + memUsedinPerc + \"%;\" + aditoMemWarn + \";\" + aditomemErr + \";0\"]\n        ```\n - setHostPerfdata = function (server, state, output, perfarr, callback)\n - updateHostAttr = function (hostObj, host, callback)\n    * hostObj\n        ```js\n        var hostObj = JSON.stringify({\n            \"templates\": [icingaConf.templatehost],\n            \"attrs\": {\n                \"display_name\": \"Adito Server Public\",\n                \"vars.group\": \"adito\",\n                \"vars.AditoServerName\": \"aditoServer\",\n                \"vars.AditoServerVersion\": \"4.6.34\",\n                \"vars.AditoStartupTime\": \"Mo.\",\n                \"vars.CPUs\": \"4\"\n            })\n        ```\n - updateServiceAttr = function (serviceObj, host, service, callback)\n\n## Examples\nCheck [test.js](https://github.com/aditosoftware/nodejs-icinga2api/blob/master/test.js) for more details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditosoftware%2Fnodejs-icinga2api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditosoftware%2Fnodejs-icinga2api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditosoftware%2Fnodejs-icinga2api/lists"}