By education I'm a Computer Scientist but my traning/trade I'm a Network/Systems administrator for a small IT Company. Perhaps a better description would be I'm the PFY to my bosses BOFH ( see
here for a description of BOFH and PFY ). And being those things, I'm both a Ba**ard and incredibly lazy. One of the things we have to do on a semi-regularly basis, is to create inventories of our computers and of the software installed on them. When I first started working here as an intern, I had to do this by hand, mainly because I was new and wasn't trusted enough to write a perl script to do the work for me while I head to the Crystal City Underground for a pint. Now that I've moved from intern to Admin and earned the trust of my superior BOFH, I can do just about whatever I want and I'm told, "If you break it, we'll fix, just make sure you learn from it!" As it stands the IT department here is only the BOFH and myself and since I'm the PFY I end up doing the inventory. The last time I did it, I whipped up some Win32 perl to do it, but I still had to go to each computer. I was designing it to go out, walk our network, and remotely pull the information I needed from all the computers but I ran into snags. The biggest one being that it wasn't guaranteed that every computer would be on and connected to the network at the given time the script would be running.
I put the idea on the back burner and went about my work. I discovered the Win32::Daemon module while coding a script to watch the user shares, and an idea came to me. Let the script run as Daemon ( or
Service in the Win32 world ) and every time the computer boots, it runs the script I'd already written for inventory, and writes the results to file ( named by its Network Node ID ) on a disk share. Anytime I needed the inventory, it'd be right there, on my network, waiting for me. Yet, again, I still run into snags...
- Should it be a daemon or should I simply make the script run in the "Start Up" directory of the machines?
- If the machine weren't rebooted periodically the script wouldn't get a chance to run and perhaps my inventory would be off or skewed. Perhaps, it would be best for the script to run as a daemon and to excute both at startup, and at midnight since some computers aren't turned off by their users, and some are turned off at the end of the day
- Deployment -- i'm still lazy...
- There are ~100 computers to inventory, across three offices which are a pretty good distance apart. As well, if you're an admin, you know that users think they're the most important person in the company and if you disturb them from their work ( or porn perusal or crossword completion ) they get all pissy and go crying to their case leader. So what I would like to do is to install the service remotely, which in itself presents more problems( you were expecting ease? ):
- Getting a list of all active computers: The Primary Domain Controller keeps a list of all computers that have connected to the network at one time or another so it makes it difficult the gather a list of all computers at the company. As well, I'm still searching for away to gather a list of all computers currently connected to the network and active.
- Can Win32::Daemon even install a service remotely?
- Where, oh where, can I get some good free pie?
I'd like to know if anyone has any ideas on any of the above entanglements, as well as if you forsee any other problems. If you have any comments or ideas about this, I'd love to hear them. As well if you'd like to send me some pie, I can provide an address...
Macphisto the I.T. Ninja
Everyone has their daemons....