{"id":900,"date":"2015-11-11T07:44:21","date_gmt":"2015-11-11T15:44:21","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=900"},"modified":"2015-11-11T07:52:22","modified_gmt":"2015-11-11T15:52:22","slug":"icinga2-on-solaris-11","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/icinga2-on-solaris-11\/","title":{"rendered":"Icinga2 on Solaris 11"},"content":{"rendered":"
I typically prefer using Nagios for network monitoring. Nagios itself is tricky to get going on Solaris and I have had a long running issue with Nagios on Solaris. Despite the issue around Nagios Core Worker timing out I still use Nagios on Solaris. If Linux is an option in a particular environment it would be preferable to use a packaged up Nagios from any of the popular distributions.<\/p>\n
Having said that I have recently tried Icinga2 on Solaris and here is some notes around getting it running. Consider yourself warned this is not pretty but it runs surprisingly well and lightweight compared to Nagios. At least on Solaris SPARC.<\/p>\n
There is a few hoops to jump through before compiling icinga2 like the compile environment and boost is particularly nasty. I will document that separate at some point in future. As I said you are on your own to get the compile environment and pre-requisites in order.<\/p>\n
Stage and compile:<\/strong><\/p>\n Issue 1 -- cmake:<\/strong><\/p>\n ** rerun cmake after fixing <\/em>CMakeLists.txt<\/p>\n Compile issue 2 -- INFINITY:<\/strong><\/p>\n ** takes a very long time<\/em><\/p>\n Compile issue 3 -- mysql.h:<\/strong><\/p>\n ** of course rerun gmake<\/p>\n Install:<\/strong><\/p>\n Attempt first run:<\/strong><\/p>\n Web front-end:<\/strong><\/p>\n Definitely read: Since I am upgrading in my case I followed header \"Upgrading Icinga Web 2<\/strong>\"<\/p>\n Before upgrade version.<\/p>\n Not sure if my upgrade actually needed the schema change(did not verify) this but I ran it just in case.<\/p>\n ** In addition although the v2.0.0-rc1 web front-end is working fine for me the latest (v2.0.0) is not. I have a problem on the dashboard I have not had time to track down. The error is: The filter column \"view\" is not allowed here.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":" I typically prefer using Nagios for network monitoring. Nagios itself is tricky to get going on Solaris and I have<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,14],"tags":[],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-icinga2","category-solaris"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/900\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\r\n# pwd\r\n\/usr\/src\r\n# wget https:\/\/github.com\/Icinga\/icinga2\/archive\/v2.3.11.tar.gz\r\n# gzip -d v2.3.11.tar.gz \r\n# tar xf v2.3.11.tar \r\n# mv v2.3.11.tar icinga-v2.3.11.tar\r\n# cd icinga2-2.3.11\/\r\n# mkdir build && cd build\r\n# cmake -D MYSQL_INCLUDE_DIR=\/usr\/mysql\/5.1\/include -D MYSQL_LIB=\/usr\/mysql\/5.1\/lib -DICINGA2_WITH_PGSQL=OFF ..\r\n<\/pre>\n
\r\n# pwd\r\n\/usr\/src\/icinga2-2.3.11\r\n# diff CMakeLists.txt CMakeLists.txt.orig \r\n135,136c135,136\r\n< set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread -lm")\r\n< set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread -DSOLARIS2=11 -D_POSIX_PTHREAD_SEMANTICS")\r\n---\r\n> set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")\r\n> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")\r\n139,140c139,140\r\n< set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl")\r\n< set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl")\r\n---\r\n> set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")\r\n> set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")\r\n<\/pre>\n
\r\n# cd build\/\r\n# gmake VERBOSE=1\r\n\r\n[..]\r\n\/usr\/src\/icinga2-2.3.11\/lib\/base\/math-script.cpp:85:18: error: \u2018INFINITY\u2019 was not declared in this scope\r\n\r\n# diff \/usr\/src\/icinga2-2.3.11\/lib\/base\/math-script.cpp \/usr\/src\/icinga2-2.3.11\/lib\/base\/math-script.cpp.orig\r\n30,31d29\r\n< #define INFINITY (__builtin_huge_val ())\r\n< \r\n\r\n# gmake VERBOSE=1\r\n<\/pre>\n
\r\n\/usr\/src\/icinga2-2.3.11\/lib\/db_ido_mysql\/idomysqlconnection.hpp:27:19: fatal error: mysql.h: No such file or directory\r\n\r\n# find \/ -name mysql.h\r\n\/usr\/mysql\/5.1\/include\/mysql\/mysql.h\r\n\/usr\/mysql\/5.5\/include\/mysql.h\r\n\r\n# cmake -D MYSQL_INCLUDE_DIR=\/usr\/mysql\/5.5\/include -D MYSQL_LIB=\/usr\/mysql\/5.1\/lib -DICINGA2_WITH_PGSQL=OFF ..\r\n-- Could NOT find yajl (missing: YAJL_LIBRARY YAJL_INCLUDE_DIR) \r\nrunning \/usr\/bin\/cmake -E copy_if_different "\/usr\/src\/icinga2-2.3.11\/third-party\/yajl\/src\/api\/yajl_parse.h" "\/usr\/src\/icinga2-2.3.11\/build\/third-party\/yajl\/src\/..\/include\/yajl" 2>&1\r\nrunning \/usr\/bin\/cmake -E copy_if_different "\/usr\/src\/icinga2-2.3.11\/third-party\/yajl\/src\/api\/yajl_gen.h" "\/usr\/src\/icinga2-2.3.11\/build\/third-party\/yajl\/src\/..\/include\/yajl" 2>&1\r\nrunning \/usr\/bin\/cmake -E copy_if_different "\/usr\/src\/icinga2-2.3.11\/third-party\/yajl\/src\/api\/yajl_common.h" "\/usr\/src\/icinga2-2.3.11\/build\/third-party\/yajl\/src\/..\/include\/yajl" 2>&1\r\nrunning \/usr\/bin\/cmake -E copy_if_different "\/usr\/src\/icinga2-2.3.11\/third-party\/yajl\/src\/api\/yajl_tree.h" "\/usr\/src\/icinga2-2.3.11\/build\/third-party\/yajl\/src\/..\/include\/yajl" 2>&1\r\n-- MySQL Include dir: \/usr\/mysql\/5.5\/include library dir: \/usr\/mysql\/5.1\r\n-- MySQL client libraries: mysqlclient_r\r\n-- Configuring done\r\n-- Generating done\r\n-- Build files have been written to: \/usr\/src\/icinga2-2.3.11\/build\r\n<\/pre>\n
\r\n# gmake install\r\n[ 1%] Built target mmatch\r\n[ 10%] Built target yajl\r\n[..]\r\n-- Installing: \/usr\/local\/share\/doc\/icinga2\/markdown\/21-debug.md\r\n-- Installing: \/usr\/local\/share\/doc\/icinga2\/markdown\/12-distributed-monitoring-ha.md\r\n<\/pre>\n
\r\n# LD_LIBRARY_PATH=\/usr\/local\/lib\/:\/usr\/mysql\/5.1\/lib\/mysql\r\n# echo $LD_LIBRARY_PATH\r\n\/usr\/local\/lib\/:\/usr\/mysql\/5.1\/lib\/mysql\r\n# \/usr\/local\/sbin\/icinga2 daemon\r\n[2015-11-10 06:59:17 -0800] information\/cli: Icinga application loader (version: r2.3.11-1)\r\n[2015-11-10 06:59:17 -0800] information\/cli: Loading application type: icinga\/IcingaApplication\r\n[..]\r\n[2015-11-10 06:59:17 -0800] information\/ConfigItem: Checked 1 UserGroup(s).\r\n[2015-11-10 06:59:17 -0800] information\/ConfigItem: Checked 1 IcingaApplication(s).\r\n[2015-11-10 06:59:17 -0800] information\/ConfigItem: Checked 1 ScheduledDowntime(s).\r\n[2015-11-10 06:59:17 -0800] information\/ScriptGlobal: Dumping variables to file '\/usr\/local\/var\/cache\/icinga2\/icinga2.vars'\r\n[2015-11-10 06:59:17 -0800] information\/DynamicObject: Restoring program state from file '\/usr\/local\/var\/lib\/icinga2\/icinga2.state'\r\n[2015-11-10 06:59:17 -0800] information\/DynamicObject: Restored 157 objects. Loaded 5 new objects without state.\r\n[2015-11-10 06:59:17 -0800] information\/ConfigItem: Triggering Start signal for config items\r\n[2015-11-10 06:59:17 -0800] information\/DbConnection: Resuming IDO connection: ido-mysql\r\n[2015-11-10 06:59:17 -0800] information\/ConfigItem: Activated all objects.\r\n[2015-11-10 06:59:17 -0800] information\/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: '1.13.0')\r\n<\/pre>\n
\nhttps:\/\/github.com\/Icinga\/icingaweb2
\nhttps:\/\/github.com\/Icinga\/icingaweb2\/blob\/master\/doc\/installation.md<\/p>\n\r\n# pwd\r\n\/var\/apache2\/2.2\/htdocs\r\n# mv master.zip icinga2_master_old.zip\r\n# wget https:\/\/github.com\/Icinga\/icingaweb2\/archive\/master.zip\r\n\r\n# unzip icinga2_master_20151110.zip\r\n[..]\r\n inflating: icingaweb2-master\/test\/php\/res\/status\/icinga.objects.cache \r\n inflating: icingaweb2-master\/test\/php\/res\/status\/icinga.status.dat \r\n<\/pre>\n
\r\n# pwd\r\n\/var\/apache2\/2.2\/htdocs\/icingaweb2\r\n# more VERSION \r\nv2.0.0-rc1\r\n\r\n# mv icingaweb2 icingaweb2.20151110\r\n# mv icingaweb2-master\/ icingaweb2\r\n<\/pre>\n
\r\n# pwd\r\n\/var\/apache2\/2.2\/htdocs\/icingaweb2.new\/etc\/schema\/mysql-upgrades#\r\n# mysql -u root -p icinga < 2.0.0beta3-2.0.0rc1.sql \r\n<\/pre>\n