Use: argument in Icinga 1 service definitions - nagios

I see references to a argument use in Icinga 1 configuration files e.g. like so:
define service {
use check_mk_passive
host_name localhost
service_description General Status
check_interval 1
# ...
On the other hand, I do not see this argument mentioned in what seems to be the appropriate piece of documentation (section on service definitions).
What is the meaning of this argument and where is this documented?

use is an attribute by which Icinga definitions may refer to templates. templates.cfg contains some examples.

Related

How can I get a protocol working under GNU-EFI?

I use GNU-EFI to develop UEFI apps. I have some trouble getting a protocol (EFI_SHELL_PROTOCOL) working under GNU-EFI. My compiler says that it is undefined. Should I include something? I already included efi.h and efilib.h. Do I need more?
Code that I tried:
EFI_SHELL_PROTOCOL shell;
The error that I got:
error: unknown type name ‘EFI_SHELL_PROTOCOL’; did you mean ‘EFI_OPEN_PROTOCOL’?
161 | EFI_SHELL_PROTOCOL shell;
The EFI_SHELL_PROTOCOL isn't part of the main UEFI interface, and is therefore not included in the main header files (e.g. efi.h) and not included in the main UEFI standard.
Instead, EFI_SHELL_PROTOCOL is just an optional extension (that may not exist, and I'd assume is only likely to exist when a shell is being used and provides it), with its own separate standard and its own separate header file.
Assuming you're using GNU's tools; the right files to include are probably efishellintf.h and efishellparm.h.
Currently, GNU-EFI does not support EFI_SHELL_PROTOCOL. It doesn't contain any related definitions about it.
If you want to use it with GNU-EFI, you can use this header file from edk2 (put it in inc folder, for example, inc/efishell.h). Then include this header file in inc/efi.h and add these lines:
lib/data.c:
EFI_GUID ShellProtocol = EFI_SHELL_PROTOCOL_GUID;
inc/efilib.h:
extern EFI_GUID ShellProtocol;
Rebuild your GNU-EFI and now you can use EFI_SHELL_PROTOCOL by locating it first.
EFI_SHELL_PROTOCOL *SP;
uefi_call_wrapper(BS->LocateProtocol, 3, &ShellProtocol, NULL, &SP);
The EFI_SHELL_PROTOCOL is fully documented in the UEFI Shell Specification (currently v2.2) which can be downloaded at https://uefi.org/specifications
GNU EFI does not currently implement EFI_SHELL_PROTOCOL or, indeed, all of the current UEFI Specification. For a reference implementation of the UEFI Shell Specification look at the EDK11 ShellPkg source code.

What does the "MODULE_INFO(retpoline, "Y")" macro?

I see in some driver source code the line:
MODULE_INFO(retpoline, "Y")
What is does?
This macro defines key-value pairs that are stored in the compiled module files. You can use the modinfo command to display them. For example, when you compile this module, modinfo my_module.ko will include a line
retpoline: Y
You can find the definition of the macro and its documentation (such as it is) by searching on an LXR interface. It works by defining a symbol in the .modinfo section of the object file.
This mechanism is used for various metadata used by the module loaded in the kernel and by userland tools such as modprobe. Standard metadata include aliases, license, version, etc.
The retpoline tag indicates that the module is built with support for a mitigation against Spectre. I don't know why driver source code would declare this explicitly: as far as I understand, this should automatically be inserted (via a header) when compiling with retpoline support: this is a compiler feature, not a property of the source code.

Find D-Bus unique address using gdbus

I'm trying to find out the best way to acquire the unique D-Bus address of an object in the D-Bus system bus using the GDBus library on Linux.
Here are version numbers of the libraries I am using:
# ls /usr/lib |grep -e dbus -e glib -e gio
libdbus-1.so
libdbus-1.so.3
libdbus-1.so.3.14.11
libdbus-glib-1.so
libdbus-glib-1.so.2
libdbus-glib-1.so.2.3.3
libgio-2.0.so
libgio-2.0.so.0
libgio-2.0.so.0.5000.3
libglib-2.0.so
libglib-2.0.so.0
libglib-2.0.so.0.5000.3
Basically, I want to know the unique name/address of the object /org/bluez/hci0 located on the system bus using gdbus library. Does anyone have an example of how I would do this using the C library?
Right now I can use the command
# dbus-monitor --system
To figure out that the address I need is :1.22. I'm almost certain that there's a better way to find the address then parsing the text output of that command.
Thanks!
Why not use the well-known name of the service to find it (and if you want to keep track of the current unique owner, use g_bus_watch_name() to get it).
In fact, in the case of bluez I don't think there's ever a reason to search for "/org/bluez/hci0" as you should be using D-Bus ObjectManager API to find the objects/interfaces that the bluez service exports.
To clarify some of the concepts here:
D-Bus address: There is no such thing as an ‘address’ in D-Bus in the way you’re thinking. There are object paths, well-known names and unique names. The term ‘address’ is used to describe the socket path which clients use to connect to the dbus-daemon, but this is unrelated to what you’re asking.
Unique name: Like :1.22, this uniquely identifies a particular connection to the dbus-daemon. Typically, each application has one connection to the daemon, so this typically identifies a single application. (However, applications can have more than one connection to the bus if they want; if so, each connection would have a different unique address). A well-known name is a consistent name for a service’s connection to the dbus-daemon, which is used as an alias for its unique name. For example, org.bluez or org.freedesktop.FileManager1 are both well-known names.
Object address: Like /org/freedesktop/SomeService/blah, this is actually called an object path. Object paths are only unique within the context of a single D-Bus connection, so the path /a/b/c will typically refer to different objects for D-Bus connections :1.1 and :1.2. (Hence the question “how can I find the unique name of the object path /a/b/c?” is ill-formed, because there may be many unique names which export such an object.)

CakePHP Having a variable in every file

I would like to have a variable $bURL available on every view/controller/element/layout of my CakePHP installation.
What is the best location to set such a variable?
bootstrap.php
This file is ideal for a number of common bootstrapping tasks:
Defining convenience functions.
Registering global constants.
...

Nagios/Check_MK: How to see effective object definition

In Nagios (or check_mk), is there a way to see what the final effective object (e.g. host) definition is after all templates, inheritance, etc.?
I want to use this as a test/debug tool to make sure my definitions end up as intended, and also to compare configurations to each other.
Thank you
There should be a 'status.dat' file in your Nagios installation (usually [Nagios_install]/var/status.dat) that contains a 'flattened' list of all defined checks.
Your main nagios.cfg file should have its location under:
Format: status_file=<file_name>
Example: status_file=/usr/local/nagios/var/status.dat
And also this file:
Format: object_cache_file=<file_name>
Example: object_cache_file=/usr/local/nagios/var/objects.cache
Hope this helps.

Resources