diff options
Diffstat (limited to 'net-analyzer/nagios-core')
-rw-r--r-- | net-analyzer/nagios-core/Manifest | 21 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/99_nagios3.conf | 15 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/99_nagios4.conf | 16 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/conf.d | 9 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf | 24 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/lighttpd_nagios4.conf | 15 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/nagios-core-3.5.1-process_cgivars.patch | 175 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/nagios-core-4.3.1-fix-upstream-issue-337.patch | 21 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/nagios3 | 52 | ||||
-rw-r--r-- | net-analyzer/nagios-core/files/nagios4-r1 | 45 | ||||
-rw-r--r-- | net-analyzer/nagios-core/metadata.xml | 34 | ||||
-rw-r--r-- | net-analyzer/nagios-core/nagios-core-3.5.1.ebuild | 216 | ||||
-rw-r--r-- | net-analyzer/nagios-core/nagios-core-4.3.1-r1.ebuild | 249 | ||||
-rw-r--r-- | net-analyzer/nagios-core/nagios-core-4.3.3.ebuild | 246 | ||||
-rw-r--r-- | net-analyzer/nagios-core/nagios-core-4.3.4.ebuild | 214 |
15 files changed, 1352 insertions, 0 deletions
diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest new file mode 100644 index 000000000000..e8ca1e072d09 --- /dev/null +++ b/net-analyzer/nagios-core/Manifest @@ -0,0 +1,21 @@ +AUX 99_nagios3.conf 377 SHA256 0bfa88db78ab036d177c68da20a8fd2f567ba8c9f54c14cfb8e1fc121641051b SHA512 53ceae12cf19d2dda1298e9faaa3ddab9b4d95163df87ccfaa0a58e54d60cf8e005ea32ed827348f1b43aee53258896972b72727145f9a20f6a4e1ce1e56ea3f WHIRLPOOL 63d6c403ff09a5365a42bd3d59e37f67a8af7fef41cb52cfb5facf1a2ff48e53c5c82096a5e3df0f5f58b5e2aac55ee7efbf6de9da2ff475c80285d9b61ea3c1 +AUX 99_nagios4.conf 368 SHA256 cae38c4b5f298c72807e14b66e8cb69bbcbca56edb127c37acf719d26f016fe8 SHA512 f0b239f23d74afa89483806f27fb9259054e46bc5742de8a414c9a9a9852a4fbdc14db45aeb148a15288196c8f7d51bdd485b005e20d012892e9e7321b50e161 WHIRLPOOL 62994852b142363847273b3d101d36929df5727f8d65ac4984a712ffbf5698e4dfc8806a170c832249cf4e9374c85c424e4cd9eb327866011e874cac52dec744 +AUX conf.d 298 SHA256 70d79394b3013848941a9b98d3de6d9321efc07896f395ca35d1cbe1cefe17d7 SHA512 81d1bbbff88b56f2bbad7e38701977eeaeaa56c6511e98fa2675960040dbad45b3243f22742b68c1a18e7df1b2fadcc6593b61e92eac42f7362ae16c33989418 WHIRLPOOL a5851b41af8dd0a12f4842c265f2e5d75742bf2f45f2d9b377104f0f3d6c99b5b942445e3de4edcf9161429aed34d61ca13eaab4491e86f407b42f7f146503ca +AUX lighttpd_nagios3-r1.conf 482 SHA256 0cbe138afb954ee434dd3ea3146fc0677533085c2f2f8fa7faebe0bb3a64e172 SHA512 8a6811432034f97aa136b4d2c4cf1382c8cb13388eec67a2112034aa1331e08fa73e5822ef78634cf25581b068280736a9efd15848fecaa7215364104778194b WHIRLPOOL a9f53e9eada7efbd4f5f538597d9040fb68c65a3f6b5b728bfa1fa83cf16ab50d8893d80a7d5ebd74352108a56e6add4b39e0f1fe37f4fbc263ad9ec434a36e3 +AUX lighttpd_nagios4.conf 325 SHA256 0326b4d25315e3c446cb98f10e0cc47eadfacae2916c59d5aa2829643f3805ae SHA512 a2f854713512ee8ee5c451235beb6ffccf2e04617a98619c6de807a5abca0a424e0581c34b4d255dcbc108e677e18bed25dd33e3d38df8fe10d7d8d4fab015c9 WHIRLPOOL 3aff58f01e9ce76b471c757b983eb6c1f3bb1a9d870b5d7f32ba1419082c23403ad01f7ffe87e1bc8ea81eb392a88e37f7be0fd229333a535f062e321d3948b5 +AUX nagios-core-3.5.1-process_cgivars.patch 5282 SHA256 a11bdc0ac1324fb36393c4850b41b089a3be1dccafc1d707b935e08c73419406 SHA512 302d45f59f9165771ae766d1a3e085995056c515fc1ae8a61341b44afe7b903f85a2ac5a7dd68d3b9f1944a6d102d63d1fd9aded5d2c916e70affec5d43b766a WHIRLPOOL 661dcf6cea30d147033c5cd16301d43f03f411d05924ac82a8f88b0fe8477d028162d3346095744006db605bc36c27fc0669ac55924eb918a85ae1d772765648 +AUX nagios-core-4.3.1-fix-upstream-issue-337.patch 810 SHA256 32848a38c3321f4234a92c9f6198682786500718ef26449cd813ee132e171369 SHA512 67c4c8efe0df27e83cf8108bd43fc6d4cc9b75b531761cd9e17794965d9fed27593897f8ab2b8569e3980abd9b52b26c1edacfed90fae1134b3bf3526a39228f WHIRLPOOL 82301ef2c447890162518816be27003b2a14537ffac59f60338b79a9895ed335af2f4afa636c7750b6defff20e15d225d4cb7e76ca4a14044d33919c35b6e509 +AUX nagios3 1208 SHA256 1d062cbc54994a470cc9bb46a3c490adb7c0a598b572d956458fb91b1b8af43b SHA512 92ed5cc52440c622af1e9346177dfd22167d2ebffbe00a24c2661d29de7dbf153f9a27143f29f7c42fb1a727b2bbb3dea0806a6adf1e1def7e010c3d7a9a5e75 WHIRLPOOL b1fa72d19c7ae75aa61901a142934324d94ea9f2cf0a31a251042688ede38551c1650b38f03429959581f7ba4d7fd7f06014849d2dabaf11120abaca02164a42 +AUX nagios4-r1 1077 SHA256 bd77faef2be15ccf201601c4e3435e2cca4a4a7db28e524e1895c0ee4349300d SHA512 91955f947b7bc70ba330bc541ea8770fafd7f4f77fbc1e08c2838029c7fbac6610adafc14afff01261d3d294cd8649456b78d2a940a87baa47808dace9ca3cc6 WHIRLPOOL 29b94928401fc9f9dea309630718c94e4f13eeac96efb3e7903be5e5f619d06e1c388b6741c11a0ad684cd87d264bb2c11a0e10ae956ffe39539cc52c37cd9d7 +DIST nagios-3.5.1.tar.gz 1763584 SHA256 ca9dd68234fa090b3c35ecc8767b2c9eb743977eaf32612fa9b8341cc00a0f99 SHA512 48e2ecb91002b08203937b12a438c87c62cd3c5c401a0ed9e861cd6d79074c7017ed373e9379f013d87dea1fd7cb8e3d85112d55c87ac91aed96b256868c112d WHIRLPOOL 2c02584702c64dbb0e353e34b758fab079eee0dc7a401e7b5947a21733758d3596401e5519e2dd7f05c89ee4835c21965d2718157fd9d6d3d20af9c853d688ca +DIST nagios-4.3.1.tar.gz 11095797 SHA256 dfc2f5f146eb508b2a28d28af7c338ef9eb604327efdc50142642026f7e79f82 SHA512 d5f1919e2b32b0b2f4c5766367f0992fcf9b1f6766f4d3386e15e318cc1f57cdae6bc07f09464fd8212bef1713948fcb25d233eab588438036f996b6c479c97e WHIRLPOOL 72032e93802fd28db71bb5a10bba703a9508c587de69ff24ce302ad4fbbd93996b4800ceb7dd4f5648e2717377409cd7a66591f177e775da1c69444d528be1a2 +DIST nagios-4.3.3.tar.gz 11101531 SHA256 1fc4c72f76c720884dd3b538dc423b44f3bdde24e014f4212e58046a1fc114b6 SHA512 588292a95342cb2d95d7b58f70442b82b99a23dd9fdc1390e9ae0743626a047e5127d77b1d7e6a1d8edd6f34a425e581bcd42459b673a0ddea14125bde4b7d9e WHIRLPOOL 1452256a79190eae90076a9b50fdac3876557a6382d15d38a0c7930ec6d286c58e44220fee3243c9bcb1ae0ef337ddadd19e3552f02049959e69eaffd9fcd4a8 +DIST nagios-4.3.4.tar.gz 11101966 SHA256 c90b7812d9e343db12be19a572e15c415c5d6353a91c5e226e432c2d4aaa44f1 SHA512 f4e92aa98151739442a225a245871d93b5560d89510bdacb1a615959b9687f7a92675f10fcba71078b104ca8f237b0155a9261d67ec66f80aec7f033b4b3e316 WHIRLPOOL dae991fe44f2d8c5457cffec6647d2b8a7ace60450e0ec2409838aaf1a6f35af1f6c56d260a36cceeede21cfd4521e695146a8c18b38d4e6689d0801d3471157 +DIST nagios-core-gentoo-icons-20141125.tar 40960 SHA256 68b715f636eb291343cab3259862bbed8b6b898520b58df522438524de3d8761 SHA512 bf109879cddd6136b76baba55d0b60b2596e37431dcf5ce0905d34a9fa292ebf7e4bde82d9a084362c486e8fac344c76d88f9298b1b85541ed70ffd608493766 WHIRLPOOL 7ec3a944b2a659b456d3168818ca5b1af3a427436e6af2f3e5d6cba6fc7b1c7bad6f552301f064df31988865b3b32fd117d9e6f61c630d6d817a51cbbbcb331d +EBUILD nagios-core-3.5.1.ebuild 6154 SHA256 074c4b31f7ec83caff01f8133cbea7c9d2f9e76db0128337e90cea704c536797 SHA512 c402040b5449fe096d40d0313ee08380089788c57da4dc780a8736eb335fb775379db4667145baed355dbbe9128e99d2662f54d9a57e44f2cc5fc35f0fe2bf01 WHIRLPOOL 3dc306c99a2d8da810a671ff7026348817f887c23e9839c9f61f9f7fbee2e39634064316f5b7e481c5c61b43cfdc96bf282be2f3cfc1c68e7ced0ae55edbdeda +EBUILD nagios-core-4.3.1-r1.ebuild 7579 SHA256 59dc0741a74350b7b8ea45eeed8ee615b9914227f4d1de0fa1e007ec43a15a4f SHA512 8a4273cb4e2f50ed4e69d190743c362db3c1c9480ea19d061501dc57e48fea7e6b3c1811107714667b7ead9eb748ee8a7a106b792f066422ef13640b14bd5aac WHIRLPOOL a3ec231a49d488aaca020f654ec5e1e531bc7c3b3623e2b35b040260bbb10d789245d4d4ed3b8684cc3a98a4e8709fca5d9ac5703e68c83287f90c374838f6a2 +EBUILD nagios-core-4.3.3.ebuild 7468 SHA256 325d84375de3679238126be983e67801ca70e60596d0ae3433778bec5f87ca88 SHA512 e1a9e9ea8aac7ab746c69925ed8d6e67fe52a0e1ef7e753ca66d205e680b9f5fedc83fbdaed1a4860bb5d63e1bb94415e1f49bca70432839cc2f72f122326d4c WHIRLPOOL 40adc8d7ee519b0837de94213731e2d98a037738fa0d52aa049e128207ab7969b1d2a97299cd291beda16b487c5eb9289a7b8619139717ad3fa7c27ce529542a +EBUILD nagios-core-4.3.4.ebuild 6647 SHA256 5a1c13161c3a456fb3d29aaaa48f19a59219357213787f3db9ae2b2d4ccc7499 SHA512 7cbe1d7067a862543aafcd591a2cf8b5abe40af75f7daa3eecbc4aa3f8afaaa5a0f366c4f4175b1680f7d30c481aa2d39296049a9963631c6c29edad465949e4 WHIRLPOOL a864fa1548be74e7976f29b87f11709bd474d079b8ff9ee0d17b5f5db5e3a911cbdaa5333eac751d1edca5ea4417555e2cc7de14a85f8f2446cbf41ea1893217 +MISC ChangeLog 9808 SHA256 b19bd88b156c5328fb84b82463c7e9f2368bb6345056f69dfba49efce0b46fdd SHA512 89556c2ce3a8975682c9b9da2098dd5410dc98e432d9aa37a7bde5445e0dfc0cbd6c2c7963b5ceee516b0ebe92df5944ab2da93af37515419921cc940d936919 WHIRLPOOL 9725300fcaf5bcd46d7f6d0ea1b6e5d58f4982a82d194a76fa795fd6596bba9e640b7cfba72471dd650b06c46dad7cad77e48043fbd0a2ce1210f3eb9233a641 +MISC ChangeLog-2015 33539 SHA256 28d8b03589fb01e259aac550508273f287ead57f10f905a9b3c26ac0a6e1232e SHA512 32de57ce104d88c4b92cf54b47cfddd3abfb5a31ab7d3ff9371b1c2b3522ccb2a97331f66284b48cf04438a6453a9b54c5f8e1b1749fd506807691f31f5ba661 WHIRLPOOL 406df23c9449f282a40f3ed16ffea06635ad3d523d1f33423305803fbb2f484997a80ba422e736b6c2bfe59ab0f2238eeb94307ba22702a28ef75b99d2050ac2 +MISC metadata.xml 1466 SHA256 ddba3ecd9908a4f0adc9959b4a7e4d1f830356e15e2a25e2ae99c9b1cae2b52a SHA512 51f819fc2cbe3b87ee96b048fd0e622f78673a29d5b42b2b8f1d963f6f71ead679b057863f5f1a56e997c1e19ff26edf52697c02f79ba89ed6a5480d0ae2296b WHIRLPOOL e87251f603285d97b018b5491b379ce60e8394fa8560df63e07418f885cf942614d78a3267f026c4ce7bc9deae62da72d5da1f0bf3636fa78b8a2d148da915f7 diff --git a/net-analyzer/nagios-core/files/99_nagios3.conf b/net-analyzer/nagios-core/files/99_nagios3.conf new file mode 100644 index 000000000000..074f9ce5e4a9 --- /dev/null +++ b/net-analyzer/nagios-core/files/99_nagios3.conf @@ -0,0 +1,15 @@ +<IfDefine NAGIOS> + ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/ + <Directory "/usr/lib/nagios/cgi-bin/"> + AllowOverride AuthConfig + Options ExecCGI + Order allow,deny + Allow from all + </Directory> + Alias /nagios /usr/share/nagios/htdocs + <Directory "/usr/share/nagios/htdocs"> + AllowOverride AuthConfig + Order allow,deny + Allow from all + </Directory> +</IfDefine> diff --git a/net-analyzer/nagios-core/files/99_nagios4.conf b/net-analyzer/nagios-core/files/99_nagios4.conf new file mode 100644 index 000000000000..b04c2980ebab --- /dev/null +++ b/net-analyzer/nagios-core/files/99_nagios4.conf @@ -0,0 +1,16 @@ +<IfDefine NAGIOS> + + ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/ + <Directory "/usr/lib/nagios/cgi-bin/"> + AllowOverride AuthConfig + Options ExecCGI + Require all granted + </Directory> + + Alias /nagios /usr/share/nagios/htdocs + <Directory "/usr/share/nagios/htdocs"> + AllowOverride AuthConfig + Require all granted + </Directory> + +</IfDefine> diff --git a/net-analyzer/nagios-core/files/conf.d b/net-analyzer/nagios-core/files/conf.d new file mode 100644 index 000000000000..68c7370c887c --- /dev/null +++ b/net-analyzer/nagios-core/files/conf.d @@ -0,0 +1,9 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Distributed monitoring users will want to configure here the ip/hostname of the central server. +# It will be used by submit_check_result_via_nsca. +NAGIOS_NSCA_HOST="localhost" + + + diff --git a/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf b/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf new file mode 100644 index 000000000000..6e2577029aca --- /dev/null +++ b/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf @@ -0,0 +1,24 @@ +server.modules += ("mod_cgi") +server.modules += ("mod_auth") +server.modules += ("mod_alias") + +auth.require += ( "/nagios" => + ( + "method" => "digest", + "realm" => "nagios", + "require" => "valid-user" + ) +) + +$HTTP["url"] =~ "^/nagios/cgi-bin/" { + dir-listing.activate = "disable" + cgi.assign = ( + ".pl" => "/usr/bin/perl", + ".cgi" => "" + ) +} + +alias.url += ( + "/nagios/cgi-bin" => "/usr/lib/nagios/cgi-bin", + "/nagios" => "/usr/share/nagios/htdocs" +) diff --git a/net-analyzer/nagios-core/files/lighttpd_nagios4.conf b/net-analyzer/nagios-core/files/lighttpd_nagios4.conf new file mode 100644 index 000000000000..a073f177f238 --- /dev/null +++ b/net-analyzer/nagios-core/files/lighttpd_nagios4.conf @@ -0,0 +1,15 @@ +server.modules += ("mod_cgi") +server.modules += ("mod_alias") + +$HTTP["url"] =~ "^/nagios/cgi-bin/" { + dir-listing.activate = "disable" + cgi.assign = ( + ".pl" => "/usr/bin/perl", + ".cgi" => "" + ) +} + +alias.url += ( + "/nagios/cgi-bin" => "/usr/lib/nagios/cgi-bin", + "/nagios" => "/usr/share/nagios/htdocs" +) diff --git a/net-analyzer/nagios-core/files/nagios-core-3.5.1-process_cgivars.patch b/net-analyzer/nagios-core/files/nagios-core-3.5.1-process_cgivars.patch new file mode 100644 index 000000000000..9d9536747794 --- /dev/null +++ b/net-analyzer/nagios-core/files/nagios-core-3.5.1-process_cgivars.patch @@ -0,0 +1,175 @@ +commit d97e03f32741a7d851826b03ed73ff4c9612a866 +Author: Eric Stanley <estanley@nagios.com> +Date: Fri Dec 20 13:14:30 2013 -0600 + + CGIs: Fixed minor vulnerability where a custom query could crash the CGI. + + Most CGIs previously incremented the input variable counter twice when + it encountered a long key value. This could cause the CGI to read past + the end of the list of CGI variables. This commit removes the second + increment, removing the possibility of reading past the end of the list + of CGI variables. + +diff --git a/cgi/avail.c b/cgi/avail.c +index 76afd86..64eaadc 100644 +--- a/cgi/avail.c ++++ b/cgi/avail.c +@@ -1096,7 +1096,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/cmd.c b/cgi/cmd.c +index fa6cf5a..50504eb 100644 +--- a/cgi/cmd.c ++++ b/cgi/cmd.c +@@ -311,7 +311,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/config.c b/cgi/config.c +index f061b0f..3360e70 100644 +--- a/cgi/config.c ++++ b/cgi/config.c +@@ -344,7 +344,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/extinfo.c b/cgi/extinfo.c +index 62a1b18..5113df4 100644 +--- a/cgi/extinfo.c ++++ b/cgi/extinfo.c +@@ -591,7 +591,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/histogram.c b/cgi/histogram.c +index 4616541..f6934d0 100644 +--- a/cgi/histogram.c ++++ b/cgi/histogram.c +@@ -1060,7 +1060,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/notifications.c b/cgi/notifications.c +index 8ba11c1..461ae84 100644 +--- a/cgi/notifications.c ++++ b/cgi/notifications.c +@@ -327,7 +327,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/outages.c b/cgi/outages.c +index 426ede6..cb58dee 100644 +--- a/cgi/outages.c ++++ b/cgi/outages.c +@@ -225,7 +225,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/status.c b/cgi/status.c +index 3253340..4ec1c92 100644 +--- a/cgi/status.c ++++ b/cgi/status.c +@@ -567,7 +567,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/statusmap.c b/cgi/statusmap.c +index ea48368..2580ae5 100644 +--- a/cgi/statusmap.c ++++ b/cgi/statusmap.c +@@ -400,7 +400,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/statuswml.c b/cgi/statuswml.c +index bd8cea2..d25abef 100644 +--- a/cgi/statuswml.c ++++ b/cgi/statuswml.c +@@ -226,8 +226,13 @@ int process_cgivars(void) { + + for(x = 0; variables[x] != NULL; x++) { + ++ /* do some basic length checking on the variable identifier to prevent buffer overflows */ ++ if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { ++ continue; ++ } ++ + /* we found the hostgroup argument */ +- if(!strcmp(variables[x], "hostgroup")) { ++ else if(!strcmp(variables[x], "hostgroup")) { + display_type = DISPLAY_HOSTGROUP; + x++; + if(variables[x] == NULL) { +diff --git a/cgi/summary.c b/cgi/summary.c +index 126ce5e..749a02c 100644 +--- a/cgi/summary.c ++++ b/cgi/summary.c +@@ -725,7 +725,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/cgi/trends.c b/cgi/trends.c +index b35c18e..895db01 100644 +--- a/cgi/trends.c ++++ b/cgi/trends.c +@@ -1263,7 +1263,6 @@ int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + +diff --git a/contrib/daemonchk.c b/contrib/daemonchk.c +index 78716e5..9bb6c4b 100644 +--- a/contrib/daemonchk.c ++++ b/contrib/daemonchk.c +@@ -174,7 +174,6 @@ static int process_cgivars(void) { + + /* do some basic length checking on the variable identifier to prevent buffer overflows */ + if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) { +- x++; + continue; + } + } diff --git a/net-analyzer/nagios-core/files/nagios-core-4.3.1-fix-upstream-issue-337.patch b/net-analyzer/nagios-core/files/nagios-core-4.3.1-fix-upstream-issue-337.patch new file mode 100644 index 000000000000..d5344a6442cb --- /dev/null +++ b/net-analyzer/nagios-core/files/nagios-core-4.3.1-fix-upstream-issue-337.patch @@ -0,0 +1,21 @@ +From e03e4fd470fbc8d4304d860d7b3b523c5d78373d Mon Sep 17 00:00:00 2001 +From: "John C. Frickson" <jfrickson@nagios.com> +Date: Thu, 2 Mar 2017 10:24:24 -0600 +Subject: [PATCH] every 15sec /var/log/messages is flooded with "nagios: + set_environment_var" + +Fix for https://github.com/NagiosEnterprises/nagioscore/issues/337 +diff --git a/base/utils.c b/base/utils.c +index 733fdef..19e20c7 100644 +--- a/base/utils.c ++++ b/base/utils.c +@@ -872,9 +872,6 @@ int set_environment_var(char *name, char *value, int set) { + + /* set the environment variable */ + if(set == TRUE) { +- log_debug_info(DEBUGL_EVENTS, 0, "set_environment_var '%s'='%s'\n", name, value); +- syslog(LOG_DAEMON|LOG_INFO, "set_environment_var '%s'='%s'\n", name, value); +- + #ifdef HAVE_SETENV + setenv(name, (value == NULL) ? "" : value, 1); + #else diff --git a/net-analyzer/nagios-core/files/nagios3 b/net-analyzer/nagios-core/files/nagios3 new file mode 100644 index 000000000000..9b9049362277 --- /dev/null +++ b/net-analyzer/nagios-core/files/nagios3 @@ -0,0 +1,52 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="checkconfig" +extra_started_commands="reload" + +nagios_config="/etc/nagios/nagios.cfg" +nagios_cmdfile="/var/nagios/rw/nagios.cmd" + +command="/usr/sbin/nagios" +command_args="-d ${nagios_config}" +pidfile="/var/nagios/nagios.lock" +start_stop_daemon_args="-e HOME=/var/nagios/home" + +depend() { + need net + use dns logger firewall + after mysql postgresql +} + +reload() +{ + checkconfig || return 1 + ebegin "Reloading configuration" + start-stop-daemon --signal HUP --pidfile ${pidfile} + eend $? +} + +checkconfig() { + ebegin "Verifying config files" + + # Silent Check + /usr/sbin/nagios -v ${nagios_config} &>/dev/null && return 0 + + # Now we know there's problem - run again and display errors + /usr/sbin/nagios -v ${nagios_config} + eend $? "Configuration Error. Please fix your configfile" +} + +start_pre() { + checkconfig || return 1 + + touch /var/nagios/nagios.log /var/nagios/status.sav + chown nagios:nagios /var/nagios/nagios.log /var/nagios/status.sav + rm -f ${nagios_cmdfile} +} + +stop_post() { + rm -f /var/nagios/status.log /var/nagios/nagios.tmp ${pidfile} \ + ${nagios_cmdfile} +} diff --git a/net-analyzer/nagios-core/files/nagios4-r1 b/net-analyzer/nagios-core/files/nagios4-r1 new file mode 100644 index 000000000000..6309fcf06706 --- /dev/null +++ b/net-analyzer/nagios-core/files/nagios4-r1 @@ -0,0 +1,45 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="checkconfig" +extra_started_commands="reload" + +nagios_config="/etc/nagios/nagios.cfg" + +command="/usr/sbin/nagios" +command_args="-d ${nagios_config}" +pidfile="/var/nagios/nagios.lock" +start_stop_daemon_args="-e HOME=/var/nagios/home" + +depend(){ + need net + use dns logger firewall + after mysql postgresql +} + +reload(){ + checkconfig || return 1 + ebegin "Reloading configuration" + start-stop-daemon --signal HUP --pidfile ${pidfile} + eend $? +} + +checkconfig(){ + ebegin "Verifying config files" + + # Silent Check + ${command} -v ${nagios_config} > /dev/null 2>&1 && return 0 + + # Now we know there's a problem. Run the check again and + # this time, display the errors. + ${command} -v ${nagios_config} + eend $? "Configuration Error. Please fix your config file." +} + +start_pre() { + # Without this, the "start" action will appear to succeed even + # when the config file contains errors and the daemon failed to + # start. + checkconfig || return 1 +} diff --git a/net-analyzer/nagios-core/metadata.xml b/net-analyzer/nagios-core/metadata.xml new file mode 100644 index 000000000000..2837e2b7ed5c --- /dev/null +++ b/net-analyzer/nagios-core/metadata.xml @@ -0,0 +1,34 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mjo@gentoo.org</email> + <name>Michael Orlitzky</name> + </maintainer> + <maintainer type="project"> + <email>sysadmin@gentoo.org</email> + <name>Gentoo Sysadmin Project</name> + </maintainer> + <longdescription> + Nagios is a host and service monitor designed to inform you of + network problems before your clients, end-users or managers do. It + has been designed to run under the Linux operating system, but + works fine under most *NIX variants as well. The monitoring daemon + runs intermittent checks on hosts and services you specify using + external "plugins" which return status information to Nagios. When + problems are encountered, the daemon can send notifications out to + administrative contacts in a variety of different ways (email, + instant message, SMS, etc.). Current status information, + historical logs, and reports can all be accessed via a web + browser. + </longdescription> + <use> + <flag name="classicui">use the classic web theme</flag> + <flag name="lighttpd">install <pkg>www-servers/lighttpd</pkg> config</flag> + <flag name="web">enable web interface</flag> + </use> + <upstream> + <remote-id type="github">NagiosEnterprises/nagioscore</remote-id> + <remote-id type="sourceforge">nagios</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-analyzer/nagios-core/nagios-core-3.5.1.ebuild b/net-analyzer/nagios-core/nagios-core-3.5.1.ebuild new file mode 100644 index 000000000000..515322c7481c --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-3.5.1.ebuild @@ -0,0 +1,216 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit depend.apache eutils multilib toolchain-funcs user + +MY_P=${PN/-core}-${PV} +DESCRIPTION="Nagios Core - Check daemon, CGIs, docs" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 ~arm ~arm64 hppa ppc ppc64 sparc x86" +IUSE="debug lighttpd perl +web vim-syntax" +DEPEND="virtual/mailx + web? ( + >=media-libs/gd-1.8.3-r5[jpeg,png] + lighttpd? ( www-servers/lighttpd dev-lang/php[cgi] ) + apache2? ( || ( dev-lang/php[apache2] dev-lang/php[cgi] ) ) + ) + perl? ( >=dev-lang/perl-5.6.1-r7:= )" +RDEPEND="${DEPEND} + !net-analyzer/nagios-imagepack + vim-syntax? ( app-vim/nagios-syntax )" + +want_apache2 + +S="${WORKDIR}/${PN/-core}" + +pkg_setup() { + depend.apache_pkg_setup + + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-3.5.1-process_cgivars.patch" + local strip="$(echo '$(MAKE) strip-post-install')" + sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in" +} + +src_configure() { + local myconf + + if use perl ; then + myconf="${myconf} --enable-embedded-perl --with-perlcache" + fi + + if use debug; then + myconf="${myconf} --enable-DEBUG0" + myconf="${myconf} --enable-DEBUG1" + myconf="${myconf} --enable-DEBUG2" + myconf="${myconf} --enable-DEBUG3" + myconf="${myconf} --enable-DEBUG4" + myconf="${myconf} --enable-DEBUG5" + fi + + if use !apache2 && use !lighttpd ; then + myconf="${myconf} --with-command-group=nagios" + else + if use apache2 ; then + myconf="${myconf} --with-command-group=apache" + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" + elif use lighttpd ; then + myconf="${myconf} --with-command-group=lighttpd" + fi + fi + + econf ${myconf} \ + --prefix=/usr \ + --bindir=/usr/sbin \ + --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \ + --datadir=/usr/share/nagios/htdocs \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins +} + +src_compile() { + emake CC=$(tc-getCC) nagios + + if use web ; then + # Only compile the CGI's if "web" useflag is set. + emake CC=$(tc-getCC) DESTDIR="${D}" cgis + fi +} + +src_install() { + dodoc Changelog INSTALLING LEGAL README UPGRADING + + if ! use web ; then + sed -i -e 's/cd $(SRC_CGI) && $(MAKE) $@/# line removed due missing web use flag/' \ + -e 's/cd $(SRC_HTM) && $(MAKE) $@/# line removed due missing web use flag/' \ + -e 's/$(MAKE) install-exfoliation/# line removed due missing web use flag/' \ + Makefile + fi + + sed -i -e 's/^contactgroups$//g' Makefile + + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install-config + emake DESTDIR="${D}" install-commandmode + if use web; then + emake DESTDIR="${D}" install-classicui + fi + + newinitd "${FILESDIR}"/nagios3 nagios + newconfd "${FILESDIR}"/conf.d nagios + + # Apache Module + if use web ; then + if use apache2 ; then + insinto "${APACHE_MODULES_CONFDIR}" + doins "${FILESDIR}"/99_nagios3.conf + elif use lighttpd ; then + insinto /etc/lighttpd + newins "${FILESDIR}/lighttpd_nagios3-r1.conf" nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver" + ewarn "out-of-the-box. Since you are not using one of them, you" + ewarn "have to configure your webserver accordingly yourself." + fi + + fi + + for dir in etc/nagios var/nagios ; do + chown -R nagios:nagios "${D}/${dir}" || die "Failed chown of ${D}/${dir}" + done + + dosbin p1.pl + + chown -R root:root "${D}"/usr/$(get_libdir)/nagios + find "${D}"/usr/$(get_libdir)/nagios -type d -print0 | xargs -0 chmod 755 + find "${D}"/usr/$(get_libdir)/nagios/cgi-bin -type f -print0 | xargs -0 chmod 755 + + keepdir /etc/nagios + keepdir /var/nagios + keepdir /var/nagios/archives + keepdir /var/nagios/rw + keepdir /var/nagios/spool/checkresults + + if use !apache2 && use !lighttpd; then + chown -R nagios:nagios "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw" + else + if use apache2 ; then + chown -R nagios:apache "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw" + elif use lighttpd ; then + chown -R nagios:lighttpd "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw" + fi + fi + + chmod ug+s "${D}"/var/nagios/rw || die "Failed Chmod of ${D}/var/nagios/rw" + chmod 0750 "${D}"/etc/nagios || die "Failed chmod of ${D}/etc/nagios" +} + +pkg_postinst() { + elog "If you want nagios to start at boot time" + elog "remember to execute:" + elog " rc-update add nagios default" + elog + + if use web ; then + elog "This does not include cgis that are perl-dependent" + elog "Currently traceroute.cgi is perl-dependent" + elog "To have ministatus.cgi requires copying of ministatus.c" + elog "to cgi directory for compiling." + + elog "Note that the user your webserver is running at needs" + elog "read-access to /etc/nagios." + elog + + if use apache2 || use lighttpd ; then + elog "There are several possible solutions to accomplish this," + elog "choose the one you are most comfortable with:" + elog + if use apache2 ; then + elog " usermod -G nagios apache" + elog "or" + elog " chown nagios:apache /etc/nagios" + elog + elog "Also edit /etc/conf.d/apache2 and add \"-D NAGIOS\"" + elif use lighttpd ; then + elog " usermod -G nagios lighttpd " + elog "or" + elog " chown nagios:lighttpd /etc/nagios" + fi + elog + elog "That will make nagios's web front end visable via" + elog "http://localhost/nagios/" + elog + else + elog "IMPORTANT: Do not forget to add the user your webserver" + elog "is running as to the nagios group!" + fi + + else + elog "Please note that you have installed Nagios without web interface." + elog "Please don't file any bugs about having no web interface when you do this." + elog "Thank you!" + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog +} + +pkg_postinst() { + einfo "Fixing permissions" + chown nagios:nagios "${ROOT}"var/nagios +} diff --git a/net-analyzer/nagios-core/nagios-core-4.3.1-r1.ebuild b/net-analyzer/nagios-core/nagios-core-4.3.1-r1.ebuild new file mode 100644 index 000000000000..7acee4a50aa9 --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-4.3.1-r1.ebuild @@ -0,0 +1,249 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs user + +MY_P=${PN/-core}-${PV} +DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation" +HOMEPAGE="http://www.nagios.org/" + +# The name of the directory into which our Gentoo icons will be +# extracted, and also the basename of the archive containing it. +GENTOO_ICONS="${PN}-gentoo-icons-20141125" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz + web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 ~arm ~arm64 hppa ppc ppc64 sparc x86" +IUSE="apache2 classicui lighttpd perl +web vim-syntax" + +# In pkg_postinst(), we change the group of the Nagios configuration +# directory to that of the web server user. It can't belong to both +# apache/lighttpd groups at the same time, so we block this combination +# for our own sanity. +# +# This could be made to work, but we would need a better way to allow +# the web user read-only access to Nagios's configuration directory. +# +REQUIRED_USE="apache2? ( !lighttpd )" + +# sys-devel/libtool dependency is bug #401237. +# +# Note, we require one of the apache2 CGI modules: +# +# * mod_cgi +# * mod_cgid +# * mod_fcgid +# +# We just don't care /which/ one. And of course PHP supports both CGI +# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the +# dependencies, and expect the user not to do anything /too/ +# stupid. (For example, installing Apache with only FastCGI support, and +# PHP with only CGI support.) +# +# Another annoyance is that the upstream Makefile uses app-arch/unzip to +# extract a snapshot of AngularJS, but that's only needed when USE=web. +# +MOD_ALIAS=apache2_modules_alias +DEPEND="sys-devel/libtool + virtual/mailx + perl? ( dev-lang/perl:= ) + web? ( + app-arch/unzip + media-libs/gd[jpeg,png] + lighttpd? ( www-servers/lighttpd[php] ) + apache2? ( + || ( + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgi] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgid] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_fcgid] ) + || ( + dev-lang/php:*[apache2] + dev-lang/php:*[cgi] + dev-lang/php:*[fpm] ) + ) + )" +RDEPEND="${DEPEND} + vim-syntax? ( app-vim/nagios-syntax )" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( "${FILESDIR}"/${PN}-4.3.1-fix-upstream-issue-337.patch ) + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_configure() { + local myconf + + if use perl; then + myconf="${myconf} --enable-embedded-perl --with-perlcache" + fi + + if use !apache2 && use !lighttpd ; then + myconf="${myconf} --with-command-group=nagios" + else + if use apache2 ; then + myconf="${myconf} --with-command-group=apache" + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" + elif use lighttpd ; then + myconf="${myconf} --with-command-group=lighttpd" + fi + fi + + econf ${myconf} \ + --prefix=/usr \ + --bindir=/usr/sbin \ + --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \ + --datadir=/usr/share/nagios/htdocs \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins +} + +src_compile() { + emake CC=$(tc-getCC) nagios + + if use web; then + # Only compile the CGIs/HTML when USE=web is set. + emake CC=$(tc-getCC) DESTDIR="${D}" cgis html + fi +} + +src_install() { + dodoc Changelog INSTALLING LEGAL README.asciidoc UPGRADING + + emake DESTDIR="${D}" install-base + emake DESTDIR="${D}" install-basic + emake DESTDIR="${D}" install-config + emake DESTDIR="${D}" install-commandmode + + if use web; then + emake DESTDIR="${D}" install-cgis + + # install-html installs the new exfoliation theme + emake DESTDIR="${D}" install-html + + if use classicui; then + # This overwrites the already-installed exfoliation theme + emake DESTDIR="${D}" install-classicui + fi + + # Install cute Gentoo icons (bug #388323), setting their + # owner, group, and mode to match those of the rest of Nagios's + # images. + insopts --group=nagios --owner=nagios --mode=0664 + insinto /usr/share/nagios/htdocs/images/logos + doins "${WORKDIR}/${GENTOO_ICONS}"/*.* + insopts --mode=0644 # Back to the default... + fi + + newinitd "${FILESDIR}"/nagios4-r1 nagios + newconfd "${FILESDIR}"/conf.d nagios + + if use web ; then + if use apache2 ; then + # Install the Nagios configuration file for Apache. + insinto "/etc/apache2/modules.d" + doins "${FILESDIR}"/99_nagios4.conf + elif use lighttpd ; then + # Install the Nagios configuration file for Lighttpd. + insinto /etc/lighttpd + newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports apache or lighttpd" + ewarn "out of the box. Since you are not using one of them, you" + ewarn "will have to configure your webserver yourself." + fi + fi + + for dir in etc/nagios var/nagios ; do + chown -R nagios:nagios "${D}/${dir}" \ + || die "failed chown of ${D}/${dir}" + done + + chown -R root:root "${D}/usr/$(get_libdir)/nagios" \ + || die "failed chown of ${D}/usr/$(get_libdir)/nagios" + + # The following two find...exec statements will die properly as long + # as chmod is only called once (that is, as long as the argument + # list is small enough). + find "${D}/usr/$(get_libdir)/nagios" -type d \ + -exec chmod 755 '{}' + || die 'failed to make nagios dirs traversable' + + if use web; then + find "${D}/usr/$(get_libdir)/nagios/cgi-bin" -type f \ + -exec chmod 755 '{}' + || die 'failed to make cgi-bins executable' + fi + + keepdir /etc/nagios + keepdir /var/nagios + keepdir /var/nagios/archives + keepdir /var/nagios/rw + keepdir /var/nagios/spool/checkresults + + if use !apache2 && use !lighttpd; then + chown -R nagios:nagios "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + else + if use apache2 ; then + chown -R nagios:apache "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + elif use lighttpd ; then + chown -R nagios:lighttpd "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + fi + fi + + chmod ug+s "${D}"/var/nagios/rw || die "failed chmod of ${D}/var/nagios/rw" + chmod 0750 "${D}"/etc/nagios || die "failed chmod of ${D}/etc/nagios" +} + +pkg_postinst() { + + if use web; then + elog "Note that your web server user requires read-only access to" + elog "${ROOT}etc/nagios." + + if use apache2 || use lighttpd ; then + elog + elog "To that end, we have changed the group of ${ROOT}etc/nagios" + elog "to that of your web server user." + elog + if use apache2; then + chown nagios:apache "${ROOT}etc/nagios" \ + || die "failed to change group of ${ROOT}etc/nagios" + + elog "To enable the Nagios web front-end, please edit" + elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\"" + elog "to APACHE2_OPTS. Then Nagios will be available at," + elog + elif use lighttpd; then + chown nagios:lighttpd "${ROOT}etc/nagios" \ + || die "failed to change group of ${ROOT}etc/nagios" + elog "To enable the Nagios web front-end, please add" + elog "'include \"nagios.conf\"' to the lighttpd configuration" + elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios" + elog "will be available at," + elog + fi + + elog " http://localhost/nagios/" + else + elog "Since you're not using either Apache or Lighttpd, you" + elog "will have to grant the necessary permissions yourself." + fi + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog +} diff --git a/net-analyzer/nagios-core/nagios-core-4.3.3.ebuild b/net-analyzer/nagios-core/nagios-core-4.3.3.ebuild new file mode 100644 index 000000000000..0b26c87cad81 --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-4.3.3.ebuild @@ -0,0 +1,246 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs user + +MY_P=${PN/-core}-${PV} +DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation" +HOMEPAGE="http://www.nagios.org/" + +# The name of the directory into which our Gentoo icons will be +# extracted, and also the basename of the archive containing it. +GENTOO_ICONS="${PN}-gentoo-icons-20141125" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz + web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha ~amd64 ~arm ~arm64 ~hppa ppc ppc64 sparc x86" +IUSE="apache2 classicui lighttpd perl +web vim-syntax" + +# In pkg_postinst(), we change the group of the Nagios configuration +# directory to that of the web server user. It can't belong to both +# apache/lighttpd groups at the same time, so we block this combination +# for our own sanity. +# +# This could be made to work, but we would need a better way to allow +# the web user read-only access to Nagios's configuration directory. +# +REQUIRED_USE="apache2? ( !lighttpd )" + +# sys-devel/libtool dependency is bug #401237. +# +# Note, we require one of the apache2 CGI modules: +# +# * mod_cgi +# * mod_cgid +# * mod_fcgid +# +# We just don't care /which/ one. And of course PHP supports both CGI +# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the +# dependencies, and expect the user not to do anything /too/ +# stupid. (For example, installing Apache with only FastCGI support, and +# PHP with only CGI support.) +# +# Another annoyance is that the upstream Makefile uses app-arch/unzip to +# extract a snapshot of AngularJS, but that's only needed when USE=web. +# +MOD_ALIAS=apache2_modules_alias +DEPEND="sys-devel/libtool + virtual/mailx + perl? ( dev-lang/perl:= ) + web? ( + app-arch/unzip + media-libs/gd[jpeg,png] + lighttpd? ( www-servers/lighttpd[php] ) + apache2? ( + || ( + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgi] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgid] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_fcgid] ) + || ( + dev-lang/php:*[apache2] + dev-lang/php:*[cgi] + dev-lang/php:*[fpm] ) + ) + )" +RDEPEND="${DEPEND} + vim-syntax? ( app-vim/nagios-syntax )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_configure() { + local myconf + + if use perl; then + myconf="${myconf} --enable-embedded-perl --with-perlcache" + fi + + if use !apache2 && use !lighttpd ; then + myconf="${myconf} --with-command-group=nagios" + else + if use apache2 ; then + myconf="${myconf} --with-command-group=apache" + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" + elif use lighttpd ; then + myconf="${myconf} --with-command-group=lighttpd" + fi + fi + + econf ${myconf} \ + --prefix=/usr \ + --bindir=/usr/sbin \ + --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \ + --datadir=/usr/share/nagios/htdocs \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins +} + +src_compile() { + emake CC=$(tc-getCC) nagios + + if use web; then + # Only compile the CGIs/HTML when USE=web is set. + emake CC=$(tc-getCC) DESTDIR="${D}" cgis html + fi +} + +src_install() { + dodoc Changelog CONTRIBUTING.md README.asciidoc THANKS UPGRADING + + emake DESTDIR="${D}" install-base + emake DESTDIR="${D}" install-basic + emake DESTDIR="${D}" install-config + emake DESTDIR="${D}" install-commandmode + + if use web; then + emake DESTDIR="${D}" install-cgis + + # install-html installs the new exfoliation theme + emake DESTDIR="${D}" install-html + + if use classicui; then + # This overwrites the already-installed exfoliation theme + emake DESTDIR="${D}" install-classicui + fi + + # Install cute Gentoo icons (bug #388323), setting their + # owner, group, and mode to match those of the rest of Nagios's + # images. + insopts --group=nagios --owner=nagios --mode=0664 + insinto /usr/share/nagios/htdocs/images/logos + doins "${WORKDIR}/${GENTOO_ICONS}"/*.* + insopts --mode=0644 # Back to the default... + fi + + newinitd openrc-init nagios + + if use web ; then + if use apache2 ; then + # Install the Nagios configuration file for Apache. + insinto "/etc/apache2/modules.d" + doins "${FILESDIR}"/99_nagios4.conf + elif use lighttpd ; then + # Install the Nagios configuration file for Lighttpd. + insinto /etc/lighttpd + newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports apache or lighttpd" + ewarn "out of the box. Since you are not using one of them, you" + ewarn "will have to configure your webserver yourself." + fi + fi + + for dir in etc/nagios var/nagios ; do + chown -R nagios:nagios "${D}/${dir}" \ + || die "failed chown of ${D}/${dir}" + done + + chown -R root:root "${D}/usr/$(get_libdir)/nagios" \ + || die "failed chown of ${D}/usr/$(get_libdir)/nagios" + + # The following two find...exec statements will die properly as long + # as chmod is only called once (that is, as long as the argument + # list is small enough). + find "${D}/usr/$(get_libdir)/nagios" -type d \ + -exec chmod 755 '{}' + || die 'failed to make nagios dirs traversable' + + if use web; then + find "${D}/usr/$(get_libdir)/nagios/cgi-bin" -type f \ + -exec chmod 755 '{}' + || die 'failed to make cgi-bins executable' + fi + + keepdir /etc/nagios + keepdir /var/nagios + keepdir /var/nagios/archives + keepdir /var/nagios/rw + keepdir /var/nagios/spool/checkresults + + if use !apache2 && use !lighttpd; then + chown -R nagios:nagios "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + else + if use apache2 ; then + chown -R nagios:apache "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + elif use lighttpd ; then + chown -R nagios:lighttpd "${D}"/var/nagios/rw \ + || die "failed chown of ${D}/var/nagios/rw" + fi + fi + + chmod ug+s "${D}"/var/nagios/rw || die "failed chmod of ${D}/var/nagios/rw" + chmod 0750 "${D}"/etc/nagios || die "failed chmod of ${D}/etc/nagios" +} + +pkg_postinst() { + + if use web; then + elog "Note that your web server user requires read-only access to" + elog "${ROOT}etc/nagios." + + if use apache2 || use lighttpd ; then + elog + elog "To that end, we have changed the group of ${ROOT}etc/nagios" + elog "to that of your web server user." + elog + if use apache2; then + chown nagios:apache "${ROOT}etc/nagios" \ + || die "failed to change group of ${ROOT}etc/nagios" + + elog "To enable the Nagios web front-end, please edit" + elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\"" + elog "to APACHE2_OPTS. Then Nagios will be available at," + elog + elif use lighttpd; then + chown nagios:lighttpd "${ROOT}etc/nagios" \ + || die "failed to change group of ${ROOT}etc/nagios" + elog "To enable the Nagios web front-end, please add" + elog "'include \"nagios.conf\"' to the lighttpd configuration" + elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios" + elog "will be available at," + elog + fi + + elog " http://localhost/nagios/" + else + elog "Since you're not using either Apache or Lighttpd, you" + elog "will have to grant the necessary permissions yourself." + fi + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog +} diff --git a/net-analyzer/nagios-core/nagios-core-4.3.4.ebuild b/net-analyzer/nagios-core/nagios-core-4.3.4.ebuild new file mode 100644 index 000000000000..6de6b181b223 --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-4.3.4.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs user + +MY_P=${PN/-core}-${PV} +DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation" +HOMEPAGE="http://www.nagios.org/" + +# The name of the directory into which our Gentoo icons will be +# extracted, and also the basename of the archive containing it. +GENTOO_ICONS="${PN}-gentoo-icons-20141125" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz + web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="apache2 classicui lighttpd perl +web vim-syntax" + +# In pkg_postinst(), we change the group of the Nagios configuration +# directory to that of the web server user. It can't belong to both +# apache/lighttpd groups at the same time, so we block this combination +# for our own sanity. +# +# This could be made to work, but we would need a better way to allow +# the web user read-only access to Nagios's configuration directory. +# +REQUIRED_USE="apache2? ( !lighttpd )" + +# sys-devel/libtool dependency is bug #401237. +# +# Note, we require one of the apache2 CGI modules: +# +# * mod_cgi +# * mod_cgid +# * mod_fcgid +# +# We just don't care /which/ one. And of course PHP supports both CGI +# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the +# dependencies, and expect the user not to do anything /too/ +# stupid. (For example, installing Apache with only FastCGI support, and +# PHP with only CGI support.) +# +# Another annoyance is that the upstream Makefile uses app-arch/unzip to +# extract a snapshot of AngularJS, but that's only needed when USE=web. +# +MOD_ALIAS=apache2_modules_alias +DEPEND="sys-devel/libtool + virtual/mailx + perl? ( dev-lang/perl:= ) + web? ( + app-arch/unzip + media-libs/gd[jpeg,png] + lighttpd? ( www-servers/lighttpd[php] ) + apache2? ( + || ( + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgi] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgid] + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_fcgid] ) + || ( + dev-lang/php:*[apache2] + dev-lang/php:*[cgi] + dev-lang/php:*[fpm] ) + ) + )" +RDEPEND="${DEPEND} + vim-syntax? ( app-vim/nagios-syntax )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_configure() { + local myconf + + if use perl; then + myconf="${myconf} --enable-embedded-perl --with-perlcache" + fi + + if use !apache2 && use !lighttpd ; then + myconf="${myconf} --with-command-group=nagios" + else + if use apache2 ; then + myconf="${myconf} --with-command-group=apache" + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" + elif use lighttpd ; then + myconf="${myconf} --with-command-group=lighttpd" + fi + fi + + econf ${myconf} \ + --prefix=/usr \ + --bindir=/usr/sbin \ + --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \ + --datadir=/usr/share/nagios/htdocs \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins +} + +src_compile() { + emake CC=$(tc-getCC) nagios + + if use web; then + # Only compile the CGIs/HTML when USE=web is set. + emake CC=$(tc-getCC) DESTDIR="${D}" cgis html + fi +} + +src_install() { + dodoc Changelog CONTRIBUTING.md README.asciidoc THANKS UPGRADING + + # There is no way to install the CGIs unstripped from the top-level + # makefile, so descend into base/ here. The empty INSTALL_OPTS + # ensures that root:root: owns the nagios executables. + cd "${S}/base" || die + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped + cd "${S}" || die + + # Otherwise this gets installed as 770 and you get "access denied" + # for some reason or other when starting nagios. The permissions + # on nagiostats are just for consistency (these should both get + # fixed upstream). + fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats + + # INSTALL_OPTS are needed for most of install-basic, but we don't + # want them on the LIBEXECDIR, argh. + emake DESTDIR="${D}" install-basic + fowners root:root /usr/$(get_libdir)/nagios/plugins + + # Don't make the configuration owned by the nagios user, because + # then he can edit nagios.cfg and trick nagios into running as root + # and doing his bidding. + emake INSTALL_OPTS="" DESTDIR="${D}" install-config + + # No INSTALL_OPTS used in install-commandmode, thankfully. + emake DESTDIR="${D}" install-commandmode + + if use web; then + # There is no way to install the CGIs unstripped from the + # top-level makefile, so descend into cgi/ here. The empty + # INSTALL_OPTS ensures that root:root: owns the CGI executables. + cd "${S}/cgi" || die + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped + cd "${S}" || die + + # install-html installs the new exfoliation theme + emake INSTALL_OPTS="" DESTDIR="${D}" install-html + + if use classicui; then + # This overwrites the already-installed exfoliation theme + emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui + fi + + # Install cute Gentoo icons (bug #388323), setting their + # owner, group, and mode to match those of the rest of Nagios's + # images. + insinto /usr/share/nagios/htdocs/images/logos + doins "${WORKDIR}/${GENTOO_ICONS}"/*.* + fi + + newinitd openrc-init nagios + + if use web ; then + if use apache2 ; then + # Install the Nagios configuration file for Apache. + insinto "/etc/apache2/modules.d" + doins "${FILESDIR}"/99_nagios4.conf + elif use lighttpd ; then + # Install the Nagios configuration file for Lighttpd. + insinto /etc/lighttpd + newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports apache or lighttpd" + ewarn "out of the box. Since you are not using one of them, you" + ewarn "will have to configure your webserver yourself." + fi + fi +} + +pkg_postinst() { + + if use web; then + if use apache2 || use lighttpd ; then + if use apache2; then + elog "To enable the Nagios web front-end, please edit" + elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\"" + elog "to APACHE2_OPTS. Then Nagios will be available at," + elog + elif use lighttpd; then + elog "To enable the Nagios web front-end, please add" + elog "'include \"nagios.conf\"' to the lighttpd configuration" + elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios" + elog "will be available at," + elog + fi + + elog " http://localhost/nagios/" + fi + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog +} |