You run it manually as user root but icinga is executing the plugin as icinga/nagios (depending on your distribution). This may produce different results as you may have different environments and/or access rights. Therefore, it is always recommended to run manually tests as the icinga user.
As earlier stated it might be a permission issues . since it is a python script check if the module dependency are there and as well check the index in the code .
Due to size is not fixed, the available index is greater than the assigned index for a list(available index > assigned index).If you try to access the empty or None element by pointing available index of list, Then you will get the List index out of range error