Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogFile is blank when running through daemon #3

Open
TJM opened this issue Jun 26, 2014 · 9 comments
Open

LogFile is blank when running through daemon #3

TJM opened this issue Jun 26, 2014 · 9 comments

Comments

@TJM
Copy link
Member

TJM commented Jun 26, 2014

[root@sf-devbatch-01 ~]# lsof -p 7151 | grep log
newrelic- 7151 root 3w REG 253,4 0 38 /var/log/newrelic-nfsiostat.log

The file is open, but there is nothing in it:
[root@sf-devbatch-01 ~]# ls -l /var/log/newrelic-nfsiostat.log
-rw-r--r--. 1 root root 0 Jun 26 12:53 /var/log/newrelic-nfsiostat.log

Only happens via "daemon"

@ghost
Copy link

ghost commented Jul 14, 2014

I'm having same issue on this.. was trying to integrate this to chef (which btw has issues due to the startup script being too simple / no proper status etc) BUT I always get an empty log file which makes things hard to know if its even working.. right now my newrelic account shows the NFS plugin but absolutely no data coming in and not sure where else to head there.

@TJM
Copy link
Member Author

TJM commented Jul 14, 2014

I cloned this from https://github.com/jduncan-rva/newRHELic and the "daemon" and "init" stuff has not gotten much love. I have another problem where it is "exiting" for some reason on a couple servers and I would love to get the log output. If you have any suggestions, I would welcome a pull request ;)

~tommy

@ghost
Copy link

ghost commented Jul 14, 2014

I'll have a look.. I did make an init script though it can be buggy it astleast has the standard functions now and a status (things like puppet/chef would recognize)

@TJM
Copy link
Member Author

TJM commented Jul 15, 2014

Something you can try...

Edit line #42 of /usr/bin/newrelic-nfsiostat (https://github.com/LarkIT/newrelic-nfsiostat/blob/master/scripts/newrelic-nfsiostat#L42) to read:
self.data = NFSPlugin(True)

To enable "Debug" mode (Yea, I know, well documented) :)

... it will emit a lot of "Debug" data, but it will also use the logs. This is probably something important to realize for fixing this issue, but it might help you too.

~tommy

@ghost
Copy link

ghost commented Jul 15, 2014

so first thing first - working init script: https://github.com/nukepuppy/newrelic-nfsiostat/commit/7c9d1f0f09f118ab12df07148e30984872480334

second as for it not even working (or logging for me)
Hmm did some testing today by modifying "/usr/lib/python2.6/site-packages/newrelicnfs/plugin.py" with some print statements to determine why i wasn't just not logging but 'not working'

original error was

errors  line 187, in _get_nfs_stat_for
    op_prefix + '/Operations[ops/second]': op_stat[0],
TypeError: 'NoneType' object is unsubscriptable

After adding some prints around op_prefix and op i realized that ReadDirPlus was always 'none'

value of op is:   Access  i think
value of op_stat is:   [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]  i think
value of op is:   Lookup  i think
value of op_stat is:   [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]  i think
value of op is:   ReadDir  i think
value of op_stat is:   [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]  i think
value of op is:   ReadDirPlus  i think
value of op_stat is:   None  i think

Only way i got this to work was removing ReadDirPLus.. not sure if others have issues with it but figured i'd mention it here (THOUGH ) I admit it may not be related to the issue at hand :) Logging being broken hehe

the change that got this working for me is here https://github.com/nukepuppy/newrelic-nfsiostat/commit/2d99b6b0efc13d6251c7e4b78554ae52a945b136

guessing the better way would be to ensure there is a handler that if the type is none we're still "OK"

@TJM
Copy link
Member Author

TJM commented Jul 15, 2014

Can you file a new issue for the ReadDirPlus thing?

Include a cat /proc/self/mountstats for at least one of the filesystems, OS, etc. I wonder why it wouldn't have READDIRPLUS? Either way, that is something that needs to be made more dynamic.

~tommy

@ghost ghost mentioned this issue Jul 16, 2014
@ghost
Copy link

ghost commented Jul 16, 2014

thanks made a different issue at #6
the readdirplus is a nfs v3 thing and not included in nfs v4 it seems

@TJM
Copy link
Member Author

TJM commented Nov 4, 2014

I think its about time to give this script some time again... If you have a few features that are working, can you submit pull requests?

Thanks

@TJM
Copy link
Member Author

TJM commented Nov 4, 2014

I have pulled the init script as part of #9 ... but we'll see if that helps "this" issue any ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant