Need Help Getting Stats to Work - NTP

This is a discussion on Need Help Getting Stats to Work - NTP ; I have been trying to get stats to work but so far have had no luck. These are my lines in my /etc/ntpd.conf enable stats statistics clockstats cryptostats peerstats loopstats rawstats sysstats statsdir "/etc/ntp/stats" filegen clockstats file clockstats type day ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Need Help Getting Stats to Work

  1. Need Help Getting Stats to Work

    I have been trying to get stats to work but so far have had no luck.

    These are my lines in my /etc/ntpd.conf

    enable stats
    statistics clockstats cryptostats peerstats loopstats rawstats sysstats
    statsdir "/etc/ntp/stats"
    filegen clockstats file clockstats type day enable
    filegen cryptostats file cryptostats type day enable
    filegen peerstats file peerstats type day enable
    filegen loopstats file loopstats type day enable
    filegen rawstats file rawstats type day enable
    filegen sysstats file sysstats type day enable

    I waited for over a day and a half and there are still no files in
    /etc/ntp/stats. (The dir does exist).

    I am sure I am doing somthing stupid. If someone knows my error please
    let me know.

    I am running ntpd 4.2.4p4

    Rob

  2. Re: Need Help Getting Stats to Work

    Rob wrote:
    > I have been trying to get stats to work but so far have had no luck.
    >
    > These are my lines in my /etc/ntpd.conf
    >
    > enable stats
    > statistics clockstats cryptostats peerstats loopstats rawstats sysstats
    > statsdir "/etc/ntp/stats"
    > filegen clockstats file clockstats type day enable
    > filegen cryptostats file cryptostats type day enable
    > filegen peerstats file peerstats type day enable
    > filegen loopstats file loopstats type day enable
    > filegen rawstats file rawstats type day enable
    > filegen sysstats file sysstats type day enable
    >
    > I waited for over a day and a half and there are still no files in
    > /etc/ntp/stats. (The dir does exist).
    >
    > I am sure I am doing somthing stupid. If someone knows my error please
    > let me know.
    >
    > I am running ntpd 4.2.4p4
    >
    > Rob


    I believe you need a trailing forward slash in your statsdir directory path:
    "/etc/ntp/stats/"

    --
    Dennis Hilberg, Jr. timekeeper(at)dennishilberg(dot)com
    NTP Server Information: http://saturn.dennishilberg.com/ntp.php

  3. Re: Need Help Getting Stats to Work

    On 2007-10-04, Rob wrote:

    > I waited for over a day and a half and there are still no files in
    > /etc/ntp/stats. (The dir does exist).


    Is that directory writable by the ntpd user?

    --
    Steve Kostecke
    NTP Public Services Project - http://support.ntp.org/

  4. Re: Need Help Getting Stats to Work

    Dennis wrote:

    > I believe you need a trailing forward slash in your statsdir path:
    > "/etc/ntp/stats/"


    I will give that a try. Thanks.

    Rob

  5. Re: Need Help Getting Stats to Work

    Steve wrote:

    > Is that directory writable by the ntpd user?


    Hmm. Interesting question. Both /usr/bin/ntpd and /etc/ntp/stats are
    owned by root with a group of root.

    [rob@myarch ~]$ ls -ld /etc/ntp/stats
    drwxr-xr-x 2 root root 48 2007-10-02 18:39 /etc/ntp/stats

    I didn't think one needed a ntpd user. I don't see one in /etc/passwd

    I can create one if needed.

    But since ntpd is being run during my init script as root, it should have
    all the privileges to write into a directory owned by root.

    Rob

  6. Re: Need Help Getting Stats to Work

    On 2007-10-04, Rob wrote:
    > Steve wrote:
    >
    >> Is that directory writable by the ntpd user?

    >
    > I didn't think one needed a ntpd user. I don't see one in /etc/passwd


    Some people prefer to run ntpd as a non-root user. This is done with the
    '-u' commandline option.

    > I can create one if needed.


    It's only neccessary if you want it.

    > But since ntpd is being run during my init script as root,


    It is if it's not started with '-u UID:GID'.

    > it should have all the privileges to write into a directory owned by
    > root.


    If that's the case try the trailing slash suggestion.

    --
    Steve Kostecke
    NTP Public Services Project - http://support.ntp.org/

  7. Re: Need Help Getting Stats to Work

    Thanks Steve. The docs on the ntp web site mention cron jobs. I have not
    created any. I assume the reference to cron jobs relates to any user
    created scripts for managing or rotating any logs created by the ntpd
    stats.

    If this isn't the case, perhaps I have forget to get a process running
    (other than ntpd)

    Rob




  8. Re: Need Help Getting Stats to Work

    On Thu, 04 Oct 2007 13:06:11 -0400, Rob wrote:

    > Dennis wrote:
    >
    >> I believe you need a trailing forward slash in your statsdir path:
    >> "/etc/ntp/stats/"

    >
    > I will give that a try. Thanks.
    >
    > Rob


    It works. I added a trailing slash and removed the quotes. And now I am
    seeing stats appearing in /etc/ntp/stats/.

    I see entries for all the stats except clockstats and sysstats.
    I wasn't expecting to see any clockstats since I do not have an external
    clock set up. But I am baffled why I am not seeing any sysstats.

    Rob
    P.S. I will probably move /etc/ntp/stats to somewhere in /var where it
    probably better belongs according to the Linux File System Hierarchy.
    (e.g. /var/ntp/stats)..


  9. Re: Need Help Getting Stats to Work

    Rob writes:

    >On Thu, 04 Oct 2007 13:06:11 -0400, Rob wrote:


    >> Dennis wrote:
    >>
    >>> I believe you need a trailing forward slash in your statsdir path:
    >>> "/etc/ntp/stats/"

    >>
    >> I will give that a try. Thanks.
    >>
    >> Rob


    >It works. I added a trailing slash and removed the quotes. And now I am
    >seeing stats appearing in /etc/ntp/stats/.


    >I see entries for all the stats except clockstats and sysstats.
    >I wasn't expecting to see any clockstats since I do not have an external
    >clock set up. But I am baffled why I am not seeing any sysstats.


    >Rob
    >P.S. I will probably move /etc/ntp/stats to somewhere in /var where it
    >probably better belongs according to the Linux File System Hierarchy.
    >(e.g. /var/ntp/stats)..


    /var/log/ntp/stats/ is probably better since it is a log file.



+ Reply to Thread