LarkIT / newrelic-nfsiostat

NFS IOSTAT Module for NewRelic
2 stars 3 forks source link

LogFile is blank when running through daemon #3

Open TJM opened 10 years ago

TJM commented 10 years ago

[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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

thanks made a different issue at https://github.com/LarkIT/newrelic-nfsiostat/issues/6 the readdirplus is a nfs v3 thing and not included in nfs v4 it seems

TJM commented 9 years ago

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 commented 9 years ago

I have pulled the init script as part of https://github.com/LarkIT/newrelic-nfsiostat/pull/9 ... but we'll see if that helps "this" issue any ;)