{"id":29916237,"url":"https://github.com/angoca/db2-nagios-configuration","last_synced_at":"2026-02-06T21:32:50.956Z","repository":{"id":145350066,"uuid":"54905962","full_name":"angoca/db2-nagios-configuration","owner":"angoca","description":"Nagios configuration to monitor DB2 databases with db2-jnrpe and monitor-db2-with-nagios scripts","archived":false,"fork":false,"pushed_at":"2016-04-12T23:10:44.000Z","size":59,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-02T05:01:59.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/angoca.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-28T16:26:43.000Z","updated_at":"2016-03-28T16:26:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1bd60ab-1002-4e7c-840d-2d8166270cac","html_url":"https://github.com/angoca/db2-nagios-configuration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angoca/db2-nagios-configuration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angoca%2Fdb2-nagios-configuration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angoca%2Fdb2-nagios-configuration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angoca%2Fdb2-nagios-configuration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angoca%2Fdb2-nagios-configuration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angoca","download_url":"https://codeload.github.com/angoca/db2-nagios-configuration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angoca%2Fdb2-nagios-configuration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29177551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2025-08-02T04:42:59.702Z","updated_at":"2026-02-06T21:32:50.950Z","avatar_url":"https://github.com/angoca.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"This project helps you to configure Nagios in order to monitor your DB2 databases with the following two mechanisms:\n\n* [Monitor DB2 with Nagios](https://github.com/angoca/monitor-db2-with-nagios)\n* [db2-jnrpe](https://github.com/angoca/db2-jnrpe)\n\nThis project consists of a set of scripts that have the structure to define the necessary objects to monitor DB2.\n\nThe objects are defined in a non-traditional way, and for this reason it is important to understand the Nagios structure (hosts, services and commands) and DB2 structure (servers, instances, databases).\n\n# Prerequisites\n\nYou need to configure both monitor mechanisms to monitor DB2.\n\n## Monitor DB2 with Nagios\n\nYou need to download and extract the scripts in a directory in each server where the scripts are executed.\nThis directory should be indicated in the Nagios configuration.\nMake sure the scripts are executable (`chmod u+x *`).\n\nIf you use SSH to run the remote scripts, make sure each server is in the known_hosts file of the .ssh directory.\nPort 22 should be opened between Nagios server and database server.\n\nIf you use nrpe to run the remove scripts, make sure the remote configuration is according your needs.\nPort 5666 should be opened between Nagios server and database server.\n\nMore information in the [Wiki of this project.](https://github.com/angoca/monitor-db2-with-nagios/wiki)\n\n## db2-jnrpe\n\nYou need to configure jnrpe in order to run the scripts from the Nagios server, or another server designated to use jnrpe.\njNRPE needs java to run.\nIt is not necessary to run jNRPE in the database servers; these scripts can run remotely via JDBC connection.\n\nIf jnrpe is not local to Nagios, the port 5666 should be opened between the Nagios server and the jNRPE server.\nIf db2-jnrpe is not local to DB2, the instance port should be opened between the jNRPE server and the database server;\nin many configurations the port is 50000, but it could change or there could be many instances to monitor.\n\nMore information in the [Wiki of this project.](https://github.com/angoca/db2-jnrpe/wiki)\n\n# Installation\n\nYou just need to download this project and put them in the Nagios configuration directory.\nIt is recommended to create a directory dedicated for these files in your Nagios configuration directory;\nthis prevents to be modified for other things different from DB2.\n\n\n## Hosts\n\nThe following elements are defined as hosts:\n\n* A server where DB2 resides is considered as a host.\n* A DB2 instance (db2sysc process) running on a server is also considered as a host.\n* A DB2 database inside an instance is also considered a host.\n\nYou need to modify this file according to your own environment.\nThe name of the objects are generic, and it is highly advisible to modify them with a Replace All function, in order to prevent errors.\nThere is an example at the nd of this file that points to a sample database in a db2inst1 instance.\n\n**NOTE**: If you are going to define only stand-alone databases, you need to preserve the `hosts_databases_db2_normal.cfg` file and delete the `hosts_databases_db2_cluster.cfg`.\nIf you are going to define OS clustered databases, you need to preserve the `hosts_databases_db2_cluster.cfg` file and delete the `hosts_databases_db2_normal.cfg`.\nFinally, if you are going to define both types of databases you preserve both files.\n\nNormally, the last two elements could not be represented as an object in Nagios, they are often treated as services;\nhowever, this structure is more flexible and allows keep track of each of these elements, even if they change the location.\n\nFor example, when a database is defined as a host, the monitoring can continue its history even if the database changes its instance or server.\n\n## Services\n\nThis is the complete set of scripts in the previously defined two projects.\nEach of these projects is defined in a different way here.\nMonitor-DB2-with-Nagios is a set of scripts run from command line, thus, they need the notion of server to connect to (via SSH or NRPE).\nOn the other hand, db2-jnrpe has the notion of database, thus, they need the properties to connect to the database.\n\n**NOTE**: If you are going to define only stand-alone databases, you need to delete the `services_databases_db2_3_cluster.cfg`.\n\n\n### Custom configuration\n\nYou can create your own services configuration file to define your own values inheriting from this configuration.\nThis allows to separate templates and global values from specific configuration.\n\n## Commands\n\nThe commands are configured to run on the server or the database.\nFor database connections, they connect directly to the database.\nInstead, for the commands run from command line, they have to connect to the server and then run the command.\nThis execution can be cluster-aware, that means when the execution is run from a passive node, all commands return OK.\n\nYou need to define the following elements for this file:\n\n* The location of the `check_by_ssh` command in the `USER5` macro.\n* The location of the SSH private key of the id_rsa/id_dsa certificate in the `USER6` macro.\n* The location of the `check_nrpe` command in the `USER7` macro\n\nWhen using OMD, the previous variables are defined in the resources.cfg file, thus you do not need to modify this file.\n\n# Cluster awareness\n\nThere are few installation where DB2 run on a active-passive node are OS level without using HADR or similar.\nHowever, they exist, even if this passive node can be considered as a waste of machine because is ON but without doing anything.\nEven, this passive machine does not have the file systems where the database resides, neither the virtual IP.\nWith these last elements, one can identify if a server is active or passive.\n\nWith the previous description, there is a script that always returns OK if it is executed from the passive node.\nIf that node becomes the active node, the script will execute the whole process and returns the corresponding value.\n\nYou need to define the directory only-mounted on the active node with the __directory_active_node variable.\nThis variable is only user in the hosts_databases_db2_3_cluster.cfg file.\n\n# Common errors\n\nWhen plugins say \"(Return code of 255 is out of bounds)\", make sure the remote host has been added in the known_hosts.\nYou can force this by executing the following command for each host:\n\n    ssh -o StrictHostKeyChecking=no hostname\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangoca%2Fdb2-nagios-configuration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangoca%2Fdb2-nagios-configuration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangoca%2Fdb2-nagios-configuration/lists"}