src/modules/systemd/dbus.c
/*
 * dbus_get_property_json appends the value of the given property as a key/val
 * pair to the given discovery json document.
 */
dbus_get_property_json appends the value of the given property as a key/val
pair to the given discovery json document.
dbus_get_property_json appends the value of the given property as a key / val pair to the given discovery json document .
int dbus_get_property_json(
              struct zbx_json *j,
              const char      *key,
              const char      *path,
              const char      *interface,
              const char      *property
) {
  char buf[1024];
  buf[0] = '\0';
  if (SUCCEED == dbus_get_property_string(
    buf,
    sizeof(buf),
    SYSTEMD_SERVICE_NAME,
    path,
    interface,
    property
  )) {
    if ('\0' != buf[0])
      zbx_json_addstring(j, key, buf, ZBX_JSON_TYPE_STRING);
    return SUCCEED;
  }
  return FAIL;
}
int dbus_get_property_json ( struct zbx_json * j , const char * key , const char * path , const char * interface , const char * property ) { char buf [ 1024 ] ; buf [ 0 ] = ' \0 ' ; if ( SUCCEED == dbus_get_property_string ( buf , sizeof ( buf ) , SYSTEMD_SERVICE_NAME , path , interface , property ) ) { if ( ' \0 ' != buf [ 0 ] ) zbx_json_addstring ( j , key , buf , ZBX_JSON_TYPE_STRING ) ; return SUCCEED ; } return FAIL ; }
dbus_get_property_json appends the value of the given property as a key/val
 pair to the given discovery json document.
dbus_get_property_json appends the value of the given property as a key / val pair to the given discovery json document .