]> granicus.if.org Git - icinga2/blobdiff - doc/21-development.md
Docs: Improve config object types chapter
[icinga2] / doc / 21-development.md
index 0f8f725a22ce707e163115edb95fe7820061db13..72bca8f338a2d8a74b94f419c119fcc7370ef393 100644 (file)
@@ -213,32 +213,34 @@ If you want to delete all breakpoints, use `d` and select `yes`.
 
 Breakpoint Example:
 
-    (gdb) b __cxa_throw
-    (gdb) r
-    (gdb) up
-    ....
-    (gdb) up
-    #11 0x00007ffff7cbf9ff in icinga::Utility::GlobRecursive(icinga::String const&, icinga::String const&, boost::function<void (icinga::String const&)> const&, int) (path=..., pattern=..., callback=..., type=1)
-        at /home/michi/coding/icinga/icinga2/lib/base/utility.cpp:609
-    609                        callback(cpath);
-    (gdb) l
-    604
-    605        #endif /* _WIN32 */
-    606
-    607                std::sort(files.begin(), files.end());
-    608                BOOST_FOREACH(const String& cpath, files) {
-    609                        callback(cpath);
-    610                }
-    611
-    612                std::sort(dirs.begin(), dirs.end());
-    613                BOOST_FOREACH(const String& cpath, dirs) {
-    (gdb) p files
-    $3 = std::vector of length 11, capacity 16 = {{static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/agent.conf"}, {static NPos = 18446744073709551615,
-        m_Data = "/etc/icinga2/conf.d/commands.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/downtimes.conf"}, {static NPos = 18446744073709551615,
-        m_Data = "/etc/icinga2/conf.d/groups.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/notifications.conf"}, {static NPos = 18446744073709551615,
-        m_Data = "/etc/icinga2/conf.d/satellite.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/services.conf"}, {static NPos = 18446744073709551615,
-        m_Data = "/etc/icinga2/conf.d/templates.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/test.conf"}, {static NPos = 18446744073709551615,
-        m_Data = "/etc/icinga2/conf.d/timeperiods.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/users.conf"}}
+```
+(gdb) b __cxa_throw
+(gdb) r
+(gdb) up
+....
+(gdb) up
+#11 0x00007ffff7cbf9ff in icinga::Utility::GlobRecursive(icinga::String const&, icinga::String const&, boost::function<void (icinga::String const&)> const&, int) (path=..., pattern=..., callback=..., type=1)
+    at /home/michi/coding/icinga/icinga2/lib/base/utility.cpp:609
+609                    callback(cpath);
+(gdb) l
+604
+605    #endif /* _WIN32 */
+606
+607            std::sort(files.begin(), files.end());
+608            BOOST_FOREACH(const String& cpath, files) {
+609                    callback(cpath);
+610            }
+611
+612            std::sort(dirs.begin(), dirs.end());
+613            BOOST_FOREACH(const String& cpath, dirs) {
+(gdb) p files
+$3 = std::vector of length 11, capacity 16 = {{static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/agent.conf"}, {static NPos = 18446744073709551615,
+    m_Data = "/etc/icinga2/conf.d/commands.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/downtimes.conf"}, {static NPos = 18446744073709551615,
+    m_Data = "/etc/icinga2/conf.d/groups.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/notifications.conf"}, {static NPos = 18446744073709551615,
+    m_Data = "/etc/icinga2/conf.d/satellite.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/services.conf"}, {static NPos = 18446744073709551615,
+    m_Data = "/etc/icinga2/conf.d/templates.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/test.conf"}, {static NPos = 18446744073709551615,
+    m_Data = "/etc/icinga2/conf.d/timeperiods.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/users.conf"}}
+```
 
 
 ### Core Dump <a id="development-debug-core-dump"></a>
@@ -634,10 +636,10 @@ vim /usr/local/icinga2/etc/icinga2/conf.d/api-users.conf
 gdb --args /usr/local/icinga2/lib/icinga2/sbin/icinga2 daemon
 ```
 
-##### Debian 9 <a id="development-linux-dev-env-debian"></a>
+#### Debian 9 <a id="development-linux-dev-env-debian"></a>
 
 ```
-apt-get -y install gdb vim git cmake make ccache build-essential libssl-dev libboost-all-dev bison flex default-libmysqlclient-dev libpq-dev libyajl-dev libedit-dev monitoring-plugins
+apt-get -y install gdb vim git cmake make ccache build-essential libssl-dev libboost-all-dev bison flex default-libmysqlclient-dev libpq-dev libedit-dev monitoring-plugins
 
 ln -s /usr/bin/ccache /usr/local/bin/gcc
 ln -s /usr/bin/ccache /usr/local/bin/g++
@@ -698,7 +700,7 @@ sudo dseditgroup -o edit -a _www -t user icingaweb2
 OpenSSL 1.0.x doesn't build anymore, so we're explicitly using 1.1.x here.
 
 ```
-brew install ccache boost cmake bison flex yajl openssl@1.1 mysql-connector-c++ postgresql libpq
+brew install ccache boost cmake bison flex openssl@1.1 mysql-connector-c++ postgresql libpq
 ```
 
 ##### ccache
@@ -1093,8 +1095,8 @@ Icinga application using a dist tarball (including notes for distributions):
   - SUSE: libopenssl-devel (for SLES 11: libopenssl1-devel)
   - Debian/Ubuntu: libssl-dev
   - Alpine: libressl-dev
-* Boost library and header files >= 1.53.0
-  - RHEL/Fedora: boost153-devel
+* Boost library and header files >= 1.66.0
+  - RHEL/Fedora: boost166-devel
   - Debian/Ubuntu: libboost-all-dev
   - Alpine: boost-dev
 * GNU bison (bison)
@@ -1115,10 +1117,6 @@ Icinga application using a dist tarball (including notes for distributions):
   - RHEL/Fedora: postgresql-devel
   - Debian/Ubuntu: libpq-dev
   - postgresql-dev on Alpine
-* YAJL (Faster JSON library)
-  - RHEL/Fedora: yajl-devel
-  - Debian: libyajl-dev
-  - Alpine: yajl-dev
 * libedit (CLI console)
   - RHEL/Fedora: libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms)
   - Debian/Ubuntu/Alpine: libedit-dev
@@ -1584,66 +1582,76 @@ Please check `appveyor.yml` for instructions.
 Install the `boost`, `python` and `icinga2` pretty printers. Absolute paths are required,
 so please make sure to update the installation paths accordingly (`pwd`).
 
-    $ mkdir -p ~/.gdb_printers && cd ~/.gdb_printers
+```
+$ mkdir -p ~/.gdb_printers && cd ~/.gdb_printers
+```
 
 Boost Pretty Printers compatible with Python 3:
 
-    $ git clone https://github.com/mateidavid/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer
-    $ git checkout python-3
-    $ pwd
-    /home/michi/.gdb_printers/Boost-Pretty-Printer
+```
+$ git clone https://github.com/mateidavid/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer
+$ git checkout python-3
+$ pwd
+/home/michi/.gdb_printers/Boost-Pretty-Printer
+```
 
 Python Pretty Printers:
 
-    $ cd ~/.gdb_printers
-    $ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
+```
+$ cd ~/.gdb_printers
+$ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
+```
 
 Icinga 2 Pretty Printers:
 
-    $ mkdir -p ~/.gdb_printers/icinga2 && cd ~/.gdb_printers/icinga2
-    $ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/icingadbg.py
+```
+$ mkdir -p ~/.gdb_printers/icinga2 && cd ~/.gdb_printers/icinga2
+$ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/icingadbg.py
+```
 
 Now you'll need to modify/setup your `~/.gdbinit` configuration file.
 You can download the one from Icinga 2 and modify all paths.
 
 Example on Fedora 22:
 
-    $ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/gdbinit -O ~/.gdbinit
-    $ vim ~/.gdbinit
-
-    set print pretty on
-    
-    python
-    import sys
-    sys.path.insert(0, '/home/michi/.gdb_printers/icinga2')
-    from icingadbg import register_icinga_printers
-    register_icinga_printers()
-    end
-    
-    python
-    import sys
-    sys.path.insert(0, '/home/michi/.gdb_printers/python')
-    from libstdcxx.v6.printers import register_libstdcxx_printers
-    try:
-        register_libstdcxx_printers(None)
-    except:
-        pass
-    end
-    
-    python
-    import sys
-    sys.path.insert(0, '/home/michi/.gdb_printers/Boost-Pretty-Printer')
-    import boost_print
-    boost_print.register_printers()
-    end
+```
+$ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/gdbinit -O ~/.gdbinit
+$ vim ~/.gdbinit
+
+set print pretty on
+
+python
+import sys
+sys.path.insert(0, '/home/michi/.gdb_printers/icinga2')
+from icingadbg import register_icinga_printers
+register_icinga_printers()
+end
 
+python
+import sys
+sys.path.insert(0, '/home/michi/.gdb_printers/python')
+from libstdcxx.v6.printers import register_libstdcxx_printers
+try:
+    register_libstdcxx_printers(None)
+except:
+    pass
+end
+
+python
+import sys
+sys.path.insert(0, '/home/michi/.gdb_printers/Boost-Pretty-Printer')
+import boost_print
+boost_print.register_printers()
+end
+```
 
 If you are getting the following error when running gdb, the `libstdcxx`
 printers are already preloaded in your environment and you can remove
 the duplicate import in your `~/.gdbinit` file.
 
-    RuntimeError: pretty-printer already registered: libstdc++-v6
-
+```
+RuntimeError: pretty-printer already registered: libstdc++-v6
+```
 
 ## Development Tests <a id="development-tests"></a>