Monitor Windows Service stats from Linux
Moderators: Developers, Moderators
Re: Monitor Windows Service stats from Linux
i have thold working to monitor a service.. HOWEVER.. it wont work if the service uses svchost.exe and it's many switches.
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
One of the reasons I despise certain OS'. Security through obscurity. What about WMI? Can you get better information from WMI?
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?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
You can run WMI queries from Cacti and store the table data in Cacti.
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: Monitor Windows Service stats from Linux
im trying to do that.. figured I'd give it a shot..TheWitness wrote: ↑Tue Jan 03, 2023 9:35 am You can run WMI queries from Cacti and store the table data in Cacti.
im using a WMI query tool to try to build the query, but in cacti, it tells me the WMI query doesnt exist
attached is the query screen shot in cacti, and a screen shot of the wmi explorer tool I am using.
Trying to get cacti to see the state is either running or not running, but cacti keeps telling me , when i look at the server im trying to query, "WMI Query Does Not Exist".
I know I am probably doing something wrong in the WMI query window in cacti.. but not sure what.
- Attachments
-
- WMIExplorer.JPG (57.84 KiB) Viewed 3115 times
-
- WMIQuery.JPG (57.2 KiB) Viewed 3115 times
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Take a look at the WMI Plugin. I've not touched in a while. It would be nicer to be able to run a SQL query against a local database vs. all the latency across the WAN to deal with.
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: Monitor Windows Service stats from Linux
thats the plug in i am using..TheWitness wrote: ↑Tue Jan 03, 2023 12:55 pm Take a look at the WMI Plugin. I've not touched in a while. It would be nicer to be able to run a SQL query against a local database vs. all the latency across the WAN to deal with.
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Example screen shot. It's pretty fast. I don't monitor big Windows farms, so I lost interest in completing this, or making it more tightly integrated into Cacti. But you can write a script server query that does a:
Code: Select all
select blah from blah blah where hostname='blah' and metric='blah';
- Attachments
-
- WMIQueryInterface.png (326.25 KiB) Viewed 3110 times
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: Monitor Windows Service stats from Linux
yup.. i did that.. my query is
ROOT\cimv2
SELECT state FROM Win32_Service WHERE Name='Spooler'
ROOT\cimv2
SELECT state FROM Win32_Service WHERE Name='Spooler'
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Cool. Here is your table of interest... I'm pretty sure anyway.mrossTTX wrote: ↑Tue Jan 03, 2023 12:56 pmthats the plug in i am using..TheWitness wrote: ↑Tue Jan 03, 2023 12:55 pm Take a look at the WMI Plugin. I've not touched in a while. It would be nicer to be able to run a SQL query against a local database vs. all the latency across the WAN to deal with.
Code: Select all
MariaDB [cacti]> desc host_wmi_cache;
+--------------+-----------------------+------+-----+---------------------+-------------------------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-----------------------+------+-----+---------------------+-------------------------------+
| host_id | mediumint(8) unsigned | NO | PRI | 0 | |
| wmi_query_id | mediumint(8) unsigned | NO | PRI | 0 | |
| field_name | varchar(50) | NO | PRI | | |
| field_value | varchar(4086) | YES | MUL | | |
| wmi_index | varchar(255) | NO | PRI | | |
| present | tinyint(4) | NO | MUL | 1 | |
| last_updated | timestamp | NO | MUL | current_timestamp() | on update current_timestamp() |
+--------------+-----------------------+------+-----+---------------------+-------------------------------+
7 rows in set (0.001 sec)
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?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
So, you graph that status as 0/1 values 'Stopped vs. Running' and then alert on 0, and send you command to start again.
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: Monitor Windows Service stats from Linux
FYI.. in Utilities , there is the WMI query tool.. assuming thats there to help you figure out the right syntax..
im running a simple one in there and getting nothing back, and in the cacti log i see
2023-01-03 12:13:40 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
2023-01-03 12:13:40 - ERROR PHP ERROR: Uncaught com_exception: Failed to create COM object `WbemScripting.SWwebLocator': Invalid syntax in C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php:600 Stack trace: #0 C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php(600): com->com() #1 C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php(36): walk_host() #2 {main} thrown in file: C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php on line: 600
my query there is namespace root\\CIMV2 , command SELECT * FROM Win32_Service
im running a simple one in there and getting nothing back, and in the cacti log i see
2023-01-03 12:13:40 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
2023-01-03 12:13:40 - ERROR PHP ERROR: Uncaught com_exception: Failed to create COM object `WbemScripting.SWwebLocator': Invalid syntax in C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php:600 Stack trace: #0 C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php(600): com->com() #1 C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php(36): walk_host() #2 {main} thrown in file: C:\inetpub\wwwroot\cacti\plugins\wmi\wmi_tools.php on line: 600
my query there is namespace root\\CIMV2 , command SELECT * FROM Win32_Service
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Okay, I never tested from a Windows server to a Windows server. So, I'm not surprised this is not working. Should work from Linux to Windows though.
If you know anything about PHP you might be able to do some debugging to fix this. If you do, a Pull request would be appreciated at the GitHub location.
It's likely an escaping issue associated the the darn backslashes.
If you know anything about PHP you might be able to do some debugging to fix this. If you do, a Pull request would be appreciated at the GitHub location.
It's likely an escaping issue associated the the darn backslashes.
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: Monitor Windows Service stats from Linux
ill try but im not that great at programing... lol
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Just look at the lines in the error. My guess is that the back slashes in the namespace are causing some issues. Double them up maybe.
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?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Monitor Windows Service stats from Linux
Hmm, looks even more fundamental than that. Spending 5 minutes on this.
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 2 guests