Page 1 of 1

SNMP plugin /extension

Posted: Tue Aug 31, 2010 7:38 pm
by Kareltje
Hi,

I'm working on a SNMP plugin based on the work that has been done for the SpeedFan application.
I'm not such a good coder but I kind of need it and it seems a nice project to work on.
I have got all the examples working an I can register the SNMP extension but when the SNMP extension tries to load the data, either via the DLL or the LIB I run into the following problem:

With the static library load:
Error: Core Temp's shared memory could not be read.
Error number: 183
Error description: The operation completed successfully

With the dynamic load:
Error: Core Temp's shared memory could not be read.
Error number: 183
Error description: The system cannot find the file specified.

As I said if I compile and try the demo program it works fine without any problem.

I know the DLL itself (GetCoreTempInfo.dll) gets loaded since it is in the process explorer and I get a whole different error when it doesn't get loaded.

It fails on

Code: Select all

GetCoreTempInfo = (fnGetCoreTempInfo)GetProcAddress(hCT, "fnGetCoreTempInfo");
or

Code: Select all

bRet = fnGetCoreTempInfoAlt(m_pCoreTempData);
depending on the way you load the library.

I suspect it has something to do with SNMP first loading my program as a DLL and then trying access the function from the GetCoreTempInfo dll and then the dll trying to access the coretemp data.
What I also do not get is the different error messages with the same code and a 183 error for that matter, I would have expected a no function found or something.

I have tried running coretemp as admin and placed the dll on various location but as I said I know it gets loaded since it is in memory.

Does someone have any ideas how to do this or what I'm doing wrong?
I'm compiling 64bit but also tried 32bit and also tried the Alt function.

Kind regards,

Karel

Re: SNMP plugin /extension

Posted: Tue Aug 31, 2010 8:35 pm
by Kareltje
Ok a small addition to this story.
I tried a small experiment with starting the SNMP service from the command line and starting the CoreTemp from that same commandline and then it works.
Still some bugs to iron out but at least it responds.

The problem here seems to be that the CoreTemp application is running in a different memory location / authority or something and can't be accessed by the SNMP service.
I have tried running the service as the same user via the "log on as" feature with the service but that didn't help either.

It seems have to do with making data accessible in global memory.
msdn explains
No clue how difficult this would be to do for CoreTemp but it would sure help.

Regards,

Karel

Re: SNMP plugin /extension

Posted: Sat Sep 04, 2010 1:41 pm
by The Coolest
Interesting. Core Temp doesn't use "Global" at this time, I'll what I can do to fix it.
I need to think whether I'll create a new global shared memory block or somehow link the existing block to a new location.

Re: SNMP plugin /extension

Posted: Sat Sep 04, 2010 7:24 pm
by Kareltje
That would be great!
I'm not sure the "Global" thing is the proper way to do it but it provides a great workaround.
As soon as you have an idea how and if you're going to implement it please let me know.
I will adapt the code and make it available to everyone, in it's current state it is a bit of a hack.
I now have another dll that runs as the user and copies the structure to global memory every second after which the snmp dll picks it up.
This gets the job done but sure isn't pretty.

The SNMP makes a great addition to the program I think and it really works well to monitor my windows server farm via cacti :)



Karel

shared memory?

Posted: Mon Oct 04, 2010 12:11 pm
by Kareltje
Hi,

Did you get around to implement a shared memory trick in the new version?


Karel

Re: SNMP plugin /extension

Posted: Mon Oct 04, 2010 12:20 pm
by The Coolest
Not in this version. I'm still trying to think on how to implement this.
I still want to keep compatibility with other addons and applications, this means the current implementation has to stay. I also need to create a new implementation, in which format and structure layout may change for more flexibility.
So I will hopefully have it done by the release of 1.0

Re: SNMP plugin /extension

Posted: Tue Oct 05, 2010 1:28 pm
by Kareltje
Hi,

Great to hear that you are still considering it as an option to add!
If you need any testing I will be happy to assist :)

Karel

Re: SNMP plugin /extension

Posted: Thu Oct 14, 2010 6:19 pm
by The Coolest
Just thought I'd update this post.
The next version will include an option in the Advanced tab of the settings box to enable global shared memory block in addition to the standard shared memory block.
This option will be disabled by default, so you will have to enable it.

Re: SNMP plugin /extension

Posted: Sun Oct 17, 2010 1:28 pm
by Kareltje
That is great!

When you do release the update I will try and release the plugin the same week. Depends a bit on my schedule and everything.

Karel

Re: SNMP plugin /extension

Posted: Wed Jul 03, 2013 8:55 pm
by hairlesshobo
I know that this is an extremely old thread, but I have CoreTemp running on all of my HTPC clients and I can monitor everything else with Cacti via SNMP but would love to find a way to throw in the data from CoreTemp as well. Any chance you finished up this plugin?

Re: SNMP plugin /extension

Posted: Mon Jan 06, 2014 5:22 pm
by alcpuGeek
Any update on this yet?

Re: SNMP plugin /extension

Posted: Thu Feb 27, 2014 2:46 pm
by willpeixoto
Kareltje how u do to get this information with SNMP .. im working in some way to monitor my cpus also..
Can u help me with this solution ?
thanks