Reading status of switches over LAN
The problem has already been solved for you.

The Lantronix XPort Pro UG and probably other Lantronix products have digital IO pins that you can read over LAN.

All you have to do is implement a bit of software to talk to the Lantronix chip and ask it for the state of all its inputs.

You'll need to level shift your 24V signal to 5V or 3.3V, but that should be pretty trivial.



Some Lantronix devices have 2 general purpose IO pins, other have more.  The protocol supports 32 pins, but I don't think any of their products actually have that many IO pins available.

Alternatively, there are companies like Moxa who sell boxes that do just what you need - including IOs that accept all kinds of voltage levels and can handle all kinds of bad things (over voltage and what have you.)  Don't reinvent the wheel if you don't have to (say, because your company wants to make a competing product.)