mirror of https://github.com/Icinga/icinga2.git
Implement the get_time() function
This commit is contained in:
parent
7504f3a3dc
commit
5ceb64d649
|
@ -17,6 +17,7 @@ random() | Returns a random value between 0 and RAND_MAX
|
||||||
log(value) | Writes a message to the log. Non-string values are converted to a JSON string.
|
log(value) | Writes a message to the log. Non-string values are converted to a JSON string.
|
||||||
log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string.
|
log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string.
|
||||||
typeof(value) | Returns the type object for a value.
|
typeof(value) | Returns the type object for a value.
|
||||||
|
get_time() | Returns the current UNIX timestamp.
|
||||||
exit(integer) | Terminates the application.
|
exit(integer) | Terminates the application.
|
||||||
|
|
||||||
## <a id="object-accessor-functions"></a> Object Accessor Functions
|
## <a id="object-accessor-functions"></a> Object Accessor Functions
|
||||||
|
|
|
@ -51,6 +51,7 @@ REGISTER_SCRIPTFUNCTION(assert, &ScriptUtils::Assert);
|
||||||
REGISTER_SCRIPTFUNCTION(string, &ScriptUtils::CastString);
|
REGISTER_SCRIPTFUNCTION(string, &ScriptUtils::CastString);
|
||||||
REGISTER_SCRIPTFUNCTION(number, &ScriptUtils::CastNumber);
|
REGISTER_SCRIPTFUNCTION(number, &ScriptUtils::CastNumber);
|
||||||
REGISTER_SCRIPTFUNCTION(bool, &ScriptUtils::CastBool);
|
REGISTER_SCRIPTFUNCTION(bool, &ScriptUtils::CastBool);
|
||||||
|
REGISTER_SCRIPTFUNCTION(get_time, &Utility::GetTime);
|
||||||
|
|
||||||
String ScriptUtils::CastString(const Value& value)
|
String ScriptUtils::CastString(const Value& value)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue