<itemizedlist>
<listitem>
<para>
- Reported version can be changed, or removed - see the "version-string" setting.
+ Reported version can be changed, or removed - see the "version-string" setting.
</para>
</listitem>
<listitem>
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>version</term>
+ <listitem>
+ <para>
+ Print version of this binary. Useful for checking which version of the PowerDNS recursor is installed on a system. Available since 3.1.5.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>version-string</term>
<listitem>
unauthorized-tcp number of TCP questions denied because of allow-from restrictions
unauthorized-udp number of UDP questions denied because of allow-from restrictions
unexpected-packets number of answers from remote servers that were unexpected (might point to spoofing)
-user-msec number of CPU milliseconds spent in 'user' mode
+uptime number of seconds process has been running (since 3.1.5)
+user-msec number of CPU milliseconds spent in 'user' mode
</screen>
In the <filename>rrd/</filename> subdirectory a number of rrdtool scripts is provided to make nice
graphs of all these numbers.
int main(int argc, char **argv)
{
+ g_stats.startupTime=time(0);
reportBasicTypes();
int ret = EXIT_SUCCESS;
::arg().setSwitch( "ignore-rd-bit", "Assume each packet requires recursion, for compatability" )= "off";
::arg().setCmd("help","Provide a helpful message");
+ ::arg().setCmd("version","Print version string ("VERSION")");
::arg().setCmd("config","Output blank configuration");
L.toConsole(Logger::Info);
::arg().laxParse(argc,argv); // do a lax parse
cerr<<::arg().helpstring(::arg()["help"])<<endl;
exit(99);
}
+ if(::arg().mustDo("version")) {
+ cerr<<"version: "VERSION<<endl;
+ exit(99);
+ }
if(::arg().mustDo("config")) {
cout<<::arg().configstring()<<endl;
}
#endif
+static uint64_t calculateUptime()
+{
+ return time(0) - g_stats.startupTime;
+}
+
static string doCurrentQueries()
{
ostringstream ostr;
addGetStat("unreachables", &SyncRes::s_unreachables);
addGetStat("chain-resends", &g_stats.chainResends);
+ addGetStat("uptime", calculateUptime);
+
#ifndef WIN32
// addGetStat("query-rate", getQueryRate);
addGetStat("user-msec", getUserTimeMsec);
uint64_t nsSetInvalidations;
uint64_t shunted;
uint64_t noShuntCNAME, noShuntExpired, noShuntSize, noShuntNoMatch, noShuntWrongType, noShuntWrongQuestion;
-
+ time_t startupTime;
typedef vector<ComboAddress> remotes_t;
remotes_t remotes;