Hi,
Big sister may be a place to start looking. Its Open Source and written in Perl and is SNMP aware. It does some of what you want to do already, so why not start there and add what you need.
You may also want to check out Snort for some of your requirements.
Also reading How do I post a question effectively? may be a good idea. This reads like a 'To do' list for a project your being paid to do and you have just listed each feature you want this system to have without providing any information as to what you have tried, read or looked at to achieve this. You also have not stated which Operating system you need this to run on. Depending on how "new" you are to Perl, I would suggest spending some time familiarising yourself with the Tutorials section of this site and, of course the PerlMonks FAQ
Martin | [reply] |
First off, please read writeup formatting tips to see how you can make your messages much more readable.
Most of these options look like they're likely candidactes for exisiting network/system management tools, which would imply you would like to be able to start command line tools and maybe process their output.
For running an external program and capturing its output, take a look at system, the section on qx/STRING/ in perlop and perlopentut.
Processing the output can take many forms, but regular expressions are usually a very handy. Also note that the perltoc manpage will list the full table of content for all the standard perl manpages (LOTS!). If you don't have man on your system use "perldoc", as in perldoc perltoc.
Good luck.
| [reply] [d/l] |
I would firstly suggest tidying your post before the magic Perl pixies do it for you. See here for some writeup formatting tips.
Otherwise, you have a lot you want to do - you probably want to investigate:
- Net::SNMP - this would be for hardware/software monitoring, but probably needs a wider infrastructure to do a lot of what you want.
- You don't say was OSs you're using - Windows? Linux? Other? Each of these will have different authentication mechanisms and event logging, so you'll need to expand a bit before we can recommend anything to see who was logged on where
- As this is a Perl discussion group, it's waaay off topic, but you may want to look at Microsoft MOM or Big Brother - both of these do monitoring and can fire off "tasks", like traceroute, nslookup etc. The latter also uses Perl for monitoring I believe
Update:Added link to Net::SNMP | [reply] |
Two alternative bits of Open Source software you might find helpful:
Nagios
OpenNMS
Both cover most of the ground you're interested in, and can be customised with user-defined extensions which call scripts or run shell commands.
Both also have active and helpful user communities.
A non-Perl answer, but then it's not really a Perl question! | [reply] |
As you specifically mention 'college' and 'students', and these questions are sysadmin in nature, I'd suggest you try asking on the sage-edu list.
Most of the items you've asked about are handled by unix commands (look up IP address, update time), and have equivalent modules in Perl. Many of the others have existing tools (nagios, big sister, and openNMS which have been mentioned, and also big brother, From some of your concerns, you should also look at a centralized log host (syslog-ng or the original syslog), mrtg for pretty graphs for management (also helps to visualize cyclical trends), tripwire for looking for signs of tampering, nmap or snort for port mapping, etc.
From the sounds of it -- you've been given a task that you know little about, no budget, and a short deadline. This isn't the type of system that you just drop in -- I've been doing sysadmin work for almost a decade, in the type of environment (higher education with unrealistic expectations, and no money to spend on project that aren't new and flashy) you're describing.
I'm guessing from the way that you've described the problem, that you're relatively new in the sysdamin field, I'd suggest that you step back, and do a little research -- I'd suggest if you're managing any UNIX systems, the purple book, and as you seem keen to do this in Perl, Perl for System Administration. Start small -- get some centralized logging or remote monitoring, then slowly build on it. This is not an overnight project. Depending on the size of your shop, it might very well take a dedicated person a month, as they hound all of the other sysadmins to install the necessary parts on their systems.
And please, please, please don't use SNMP if you don't have to.
| [reply] |
- Identify various devices on the network.
Devices include all hardware devices connected to the network i.e. PC's, Servers ,Printers & Plotters
nmap or maybe netdisco.
- Ping remote hosts to verify the network connection.
Using Perl Commands to verify network connectivity.
Net::Ping, ping or Nagios.
- Ping hosts along a route to isolate a hardware or software problem.
Traceroute (isn't as effective in a switched environment).
- See what ports various machines are using.
Check to see what ports a device is using and what state these port are in i.e. Listening, Closed, Established.
nmap (hint: the "-oG - " option is nice). If you are on the local host then you might want to look at NetStat.
- Look up IP addresses of hosts using a device name.
Given an IP address the program will be able to look up a host based on the IP address and return the host name.
host or nslookup.
- Obtain information about all users logged on to a particular host (important security utility for institutions such as the college).
Can see what student is /was logged onto a particular machine.
Important if machine has been tampered with e.g. passwords hacked.
You probably want a log server. You could also use Net::SNMP or net-snmp I suppose.
- Allow user obtain and configure time settings from remote hosts (important to allow many software packages run properly).
NTP protocol. ntpdate. IIRC DHCP can be used to update the clients time also.
- Automatically send an alert (e-mail) to the college work request system detailing the detection and fault of a hardware/ software problem.
Nagios (plus QuickPage if you want to send text pages-- sending an e-mail doesn't do any good if the mailserver went down or the network died).
| [reply] |
Am slowly working through the suggestions given,Much appreciated.As i said previously I am new to Perl.
I am trying ti use the NMAP::Scanner module but get the following error when trying to execute the code:
Can't call method"as_xml" on an undefined value at
c:/Perl/site/lib/Nmap/scanner/Backend/results.pm
All help greatly appreciated.Code is found here:
http://search.cpan.org/~maxschube/Nmap-Scanner-0.9/lib/Nmap/Scanner.pm#SYNOPSIS
| [reply] |