DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-07-02 01:47:37

fordem
Member
Registered: 2007-01-26
Posts: 1938

SNMP

Has anyone done any work on adding SNMP management to this unit?

I'm assuming that it just needs a kernel module or something similar that can be added through the fun_plug, but since my linux knowledge has been mostly acquired in this forum, figuring out what to do is a little beyond me.

Any ideas?  Am I totally wrong in my assumption?  Is it easier? Is it harder?  Is this a ridiculous question?

Offline

 

#2 2007-07-02 05:53:38

frodo
Member
From: Stockholm, Sweden
Registered: 2007-01-17
Posts: 259

Re: SNMP

You will have to compile a snmp daemon and start it from fun_plug.

For instance snmpd. However this will eat up preciouses memory as everything running.

Offline

 

#3 2007-07-03 20:34:50

ldomaigne
Member
Registered: 2007-06-24
Posts: 28

Re: SNMP

Hi Fordem,

The SNMP Agent of choice in the Linux world is Net-SNMP:  http://www.net-snmp.org/

However, for such a device like the DNS-323, you would need a tailored MIB / Agent that would reflect the status information you can obtain via the Web Console.
Could be cool to program, actually wink

Cheers,
Loïc.

Offline

 

#4 2007-07-03 21:28:24

zeroday
Member
Registered: 2007-07-01
Posts: 136
Website

Re: SNMP

ldomaigne wrote:

Hi Fordem,

The SNMP Agent of choice in the Linux world is Net-SNMP:  http://www.net-snmp.org/

However, for such a device like the DNS-323, you would need a tailored MIB / Agent that would reflect the status information you can obtain via the Web Console.
Could be cool to program, actually wink

Cheers,
Loïc.

better it seems to me to have ie. telnet running through funplug, than running some scripts for
1. uptime
2. fanspeed
3. temperature
4. hdd space

of course webinterface could also possible, but you have to login everytime and scrape content

Offline

 

#5 2007-07-03 22:28:34

ldomaigne
Member
Registered: 2007-06-24
Posts: 28

Re: SNMP

zeroday wrote:

better it seems to me to have ie. telnet running through funplug, than running some scripts for
1. uptime
2. fanspeed
3. temperature
4. hdd space

Better, perhaps not. But easier to implement!

Cheers,
Loic.

Offline

 

#6 2008-06-06 22:29:58

spyd4r
New member
Registered: 2008-06-06
Posts: 1

Re: SNMP

Has anyone written snmp monitoring for this unit yet?

Offline

 

#7 2008-06-06 23:21:53

bspvette86
Member
Registered: 2008-05-09
Posts: 81

Re: SNMP

Due to a nice feature of the DNS, you capture any info you want off the box by going to the different info pages in the /proc directory via the built in web server.

Ie
http://dns323/proc/version
http://dns323/proc/cpuinfo
http://dns323/proc/net/arp
   etc...

CD to /proc and do an ls -l to figure out all the stuff you can read via simple http requests.


Regards,
bspvette

Offline

 

#8 2008-06-07 04:16:24

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: SNMP

One thing to note about the above, It works on F/W 1.05, but not on 1.04.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#9 2008-09-19 19:49:51

philw
Member
Registered: 2008-09-19
Posts: 41
Website

Re: SNMP

My 323 arrived yesterday and whilst I'm waiting for it to finish backing up my system I wrote a Vista Gadget thing to monitor it. So far I can of course display all the stuff I can get from the web server pages, and I've got a "shut down" and "restart" button - you know the sort of  thing. I'm too lazy to log into the thing to check how it is and muck about with it.

It's hardly SNMP and I have to poll, but at last I know what's up with the thing.

Those /proc references are precisely what I need to add a few more features. However as I can't actually telnet to the thing, I can't actually get a list of all the things I could get there... would someone care to post a full list? I'll publish the gadget once it's done, if anyone can't think of a better way to do this.

Offline

 

#10 2008-09-19 20:04:10

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: SNMP

it will be interesting to see your code/gadget.  At one point I had a html page on my d/t performing the "post" to simulate the shutdown button click, but your solutions sounds nicer :-)
hth.

lu


Attachments:
Attachment Icon proc.txt, Size: 4,070 bytes, Downloads: 383

Offline

 

#11 2008-09-19 20:26:05

philw
Member
Registered: 2008-09-19
Posts: 41
Website

Re: SNMP

Thanks for the list - I'll have a poke about with that the next time it rains, if no one else suggests an easier way to do this.

I just put the gadget here:
  http://www.wigglesworld.klebos.com/stuf … efault.asp

The version there (0.3) is slightly brain-damaged as the "shut down" and "restart" functions aren't enabled - I'm in the middle of a big multi-day backup to this box so I can't test shut down/ restart, although those should be trivial to implement.

All polite feedback/ suggestions welcome, although I don't guarantee to take notice of it. As I've only the one system here to test on, there may be some crass defect which prevents it working for others for all I know.


This is basically doing the same POST thing you mention; you could run it on a web server except for a few "gadget" specific surrounding things which I only just learned about.

Offline

 

#12 2008-09-19 21:30:57

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: SNMP

I notice that your gadget asks for the username/password for the dns323.  The security is only half hartedly implemented (search this forum) though and is a bit of a joke really.  Saying that you could argue that it is designed for the home market. You don't need to login to access the files in /proc or /etc - just point your webbrowser at them and hey presto, so some of the stuff you are looking to display you may not even need to log in for!  So you are left to secure the box yourself (i.e. router security etc).  Indeed I have just noticed that the 323 exposes the details of your email account (inc. pw), oops!
As to suggestions, although the unit has a feature to force-shutdown the box on reaching a certain temp, it may be nice if your gadget can store green/amber/red temp values (user specified) with the display showing the temp in green/amber/red so the automatic *force*-shutdown does not have to be used.  Just a suggestion (which many may think useless!)
lu

Last edited by luusac (2008-09-19 21:35:56)

Offline

 

#13 2008-09-19 22:09:53

philw
Member
Registered: 2008-09-19
Posts: 41
Website

Re: SNMP

Yeah, I noticed that. I even managed to kill the www server on it without being logged in... definitely you don't want to expose that server to the wild internet! Fortunately killing the www didn't kill the box, as my day-and-a-half backup is still running and I don't want to check if it fails sensibly on that! Whilst it's a bit careless, it's a domestic machine as you say.

I like the idea of red/green/amber - I'll put it on the list.

Offline

 

#14 2008-09-19 22:47:55

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: SNMP

if you haven't already, look on the wiki for ffp - very useful, and should you need to host any web stuff on the box it comes with lighthttp.
lu

Offline

 

#15 2008-09-20 18:04:40

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: SNMP

philw wrote:

The version there (0.3) is slightly brain-damaged as the "shut down" and "restart" functions aren't enabled - I'm in the middle of a big multi-day backup to this box so I can't test shut down/ restart, although those should be trivial to implement.

To get the shutdown to work I had to uncomment the line

makeServerRequest( "/goform/sysShutDown",  "GET", null, null ); //Get tools page.

Note that I also had to change the POST to a GET.  I haven't spared any thought yet as to why I needed to do this given your code.

A few other suggestions:

password field should show asterisks when typing (change type="text" to type="password" on the relevant line in settings.html)
pressing your reload button displays plain text password - not sure how to change this other than not to display it on refresh/reload (i.e. remove the code which fetched the pwd)
change function of 'refresh stats' to 'restart dns' - as you mention on your webpage the 'reload gadget' serves the same function (which I see is already on your todo list)
allow tickboxes in the options page to allow user selection of individual items - i.e. some people may not need dns/gw/mac address etc displayed and may prefer something else instead.
colour buttons :-)

I mentioned previously that logging in was not required to shutdown the unit or for some other purposes.  Various complaints have been made about the security on the dns323, and in the future, who knows, dlink may actually do something about this - which would break you gadget if you do modify it.  But in any case the dns323 admin web interface (that you are using to populate the gadget) is irrelevant and unnecessary to access files in /proc and /etc

As to signing the gadget look here: it seems pretty simple.  Also see http://msdn.microsoft.com/en-us/library/bb498012.aspx

cheers

lu

Offline

 

#16 2008-09-20 19:47:23

philw
Member
Registered: 2008-09-19
Posts: 41
Website

Re: SNMP

Thanks; all good stuff. I finally finished my monster backup so I made the shut down thing work in 0.4 because I could test it. I found the POST error - you just need to GET the page; there's nothing to post. My mistake on the original. I rewrote my http stuff completely as I can see what I should do with this next anyhow.

Other stuff - I put it on the list.

I had a look at the *nix commands and I think I'll make the thing multi-page with the output of those things. Or I'll worry about something else - I'd forgotten why I disliked Unix so much but now it's all coming back to me.

Offline

 

#17 2008-09-23 12:56:26

philw
Member
Registered: 2008-09-19
Posts: 41
Website

Re: SNMP

Ok I finished that as far as I'm going with it for now - the version at the link above has pretty restart/ shutdown buttons and multiple pages of data from the NAS.

Pages:
  network : Not much use as they don't change.
  status: usage and temperature graphs, configurable temperature colouring
  os: garbage from *nix plus the uptime as hh:mm:ss
  clients: client IP address lists

Buttons:
refresh (there's also a configurable background refresh timer)
restart
shut down

Settings for all the stuff I think needs to be a setting.
That's version 0.7.

------
limitations: only implemented for a single disk NAS, no RAID.

-------
Other stuff:
I went through the other god-awful /proc commands, some of which crashed the www server on the NAS. I did think of implementing a "crash www server" button, but on balance I decided to ignore all those I could see no use for.

It's table-driven so it's pretty easy to add other commands - you just need to know the url and the format of the output. Then add an entry into the state-table for the command, with a reference to the formatter to parse the output from it.

Offline

 

#18 2008-09-23 17:00:44

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: SNMP

Does it work for XP as well? Well, i guess I'll just try it........

Offline

 

#19 2010-01-22 13:31:49

Adain21
New member
Registered: 2010-01-22
Posts: 1

Re: SNMP

I will try  XP WIndows Then i will tell you...

-----------------------------------------
SNMP Scanner

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB