Has anyone tried Powershell?
Moderators: Developers, Moderators
Has anyone tried Powershell?
I'm running spine and custom WMI VB scripts for a few polls (on a Windows server box, with IIS). Out of curiosity, has anyone tried using Powershell for custom scripts? If so, how'd it work, or did it?
My hunch is the main time waster would be waiting for PS to actually invoke - i've heard it said that any shell that takes more than 5 seconds to load isn't really a shell... i may have to agree.
Cheers.
My hunch is the main time waster would be waiting for PS to actually invoke - i've heard it said that any shell that takes more than 5 seconds to load isn't really a shell... i may have to agree.
Cheers.
Funny you should bring this up...I was just reading an article about the improvements to powershell 2.0 and was thinking it would make a good replacement for WMI scripts (and lots of other things!). I haven't given it a try yet though, nor do recall anyone publishing powershell scripts. In theory, it really shouldn't be any different from other scripts to get working with Cacti.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
I've been doing a fair amount of work outside of Cacti w/ powershell. The biggest hassle I see is figuring out how to a) call powershell from within cacti, since PS is designed to not allow code to run without command line execution - i.e., you can't go start->run->mypowershellscript.ps1 . You have to be w/in the powershell cli, then run the script. and b) how to stop it from taking 5 to 10 seconds to load.
But the thought is intriguing, especially since it would allow much better interaction with WMI.
But the thought is intriguing, especially since it would allow much better interaction with WMI.
You apparently can though by changing some settings. More details: http://technet.microsoft.com/en-us/libr ... 76949.aspxspeedbird wrote: a) call powershell from within cacti, since PS is designed to not allow code to run without command line execution - i.e., you can't go start->run->mypowershellscript.ps1 .
Read through Speeding Up PowerShell Startup and the other linked posts with the ngen scripts?speedbird wrote: b) how to stop it from taking 5 to 10 seconds to load.
Otherwise, an ideal dream is that Cacti will one day support script servers for customizable languages i.e. perl script server, powershell script server, etc. That way the main executable stays open during the polling cycle and gets fed scripts instead of a new instance launched for every script.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Has anyone tried Powershell?
The real problem is being able to use it from a linux box. LOL.
Well at least for me it is, I have a lot of devices and windows boxes just can't handle it, I've been able to get the wmi queries to work from linux, barely.
I am a big powershell user, between vmware, sql, exchange, desktop management. It's great, and you can use the powershell get-wmi to gather wmi objects as well as dig through them, and get values. You can also have it do things multithreaded, etc... But getting those results back to a linux box might be a pain (not impossible) Powershell is heavily into the .NET, so I have a hard time seeing there being a port to linux.
But for the windows cacti machines, it could be handy.
Well at least for me it is, I have a lot of devices and windows boxes just can't handle it, I've been able to get the wmi queries to work from linux, barely.
I am a big powershell user, between vmware, sql, exchange, desktop management. It's great, and you can use the powershell get-wmi to gather wmi objects as well as dig through them, and get values. You can also have it do things multithreaded, etc... But getting those results back to a linux box might be a pain (not impossible) Powershell is heavily into the .NET, so I have a hard time seeing there being a port to linux.
But for the windows cacti machines, it could be handy.
Re: Has anyone tried Powershell?
reviving an old topic, but you can do powershell on linux
https://learn.microsoft.com/en-us/power ... rshell-7.3
https://learn.microsoft.com/en-us/power ... rshell-7.3
Re: Has anyone tried Powershell?
Well, that's cute. MS made PowerShell OSS. So, this makes sense.
Before history, there was a paradise, now dust.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Has anyone tried Powershell?
A script server for powershell might be interesting. I'm not sure how it would work or course.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Re: Has anyone tried Powershell?
PowerShell can be run directly and passed a script plus parameters to run. There may be startup issues if many modules are set to auto-load when PowerShell starts, but a bare PowerShell should not take long at all.
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Has anyone tried Powershell?
I read that as Script Server for Powershell may not be required.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 0 guests