Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Integrate OCS Inventory with Grafana or Zabbix to Monitoring PC's #280

Open
lexcorp opened this issue Nov 26, 2020 · 4 comments
Open

Comments

@lexcorp
Copy link

lexcorp commented Nov 26, 2020

Integrate OCS Inventory with Grafana or Zabbix to Monitoring PC's

@lexcorp
Copy link
Author

lexcorp commented Nov 30, 2020

How does this work? Is it running on the OCS Inventory side or on the nagios side?

https://metacpan.org/pod/Ocs::Nagios

NAME
Ocs::Nagios - Import OCS Inventory devices in Nagios
VERSION
Version 0.02

@lexcorp
Copy link
Author

lexcorp commented Nov 30, 2020

@charleneauger charleneauger changed the title Integrate OCS Inventory with Grafana or Zabbix to Monitoring PC's [FEATURE] Integrate OCS Inventory with Grafana or Zabbix to Monitoring PC's Dec 11, 2020
@gillesdubois
Copy link
Member

Hi @lexcorp

These implementation are most likely really old.
For compatibility reason, I can't recommend you to use them.

It would be indeed a nice thing to add, however we currently have a lot going on in our roadmap.

If this request is really important for you, developpment can be done faster trough the ocs professional offer :

In any case it will be added to our roadmap but don't expect it anytime soon.

Regards,
Gilles.

@thenextuser
Copy link

Hello,
I just stumbled across this and wanted to make a quick comment.

I am not familiar with Nagios or Grafana, but in Zabbix the OCS inventory can be used in a rudimentary way if you know which values you want to monitor.
It might be possible to apply the procedure to the other applications as well.

Since the OCS is based on an SQL database, it is of course possible to read out values and set triggers for alarms via SQL queries from Zabbix.

To do this, place a shell script on the OCS server with which the SQL database can be read (preferably with a dedicated user who only has read access to the database).

For example, my script looks like this:

#!/bin/bash NL=$'\n' OUTPUT=$(mysql -u ocsread --password=SUPERSAFEPASSWORD -e "$1" ocs -s -N) printf "%s\n" "$NL$OUTPUT"

In Zabbix you can then create a template and put items in there and formulate SQL queries in them. The query can then be sent to the script, for example like this:

ocs.check["SELECT NAME FROM hardware WHERE OSVERSION = '10.0.19044' AND OSNAME NOT LIKE '%erve%'\"]

The function 'ocs.check' must of course be connected to the shell script in the Zabbix agent config beforehand, like this:
UserParameter=ocs.check[*],/home/ocs/ocs_check.sh $1

Here you can then work with the usual Zabbix macros, mappings and triggers to generate the desired information and alarms.

For example, in Zabbix we monitor the hard disk space and the supported Windows release versions of our client computers.

This is of course the 'quick&dirty' method and should only be used within encrypted communication channels between Zabbix and OCS inventory, but works wonderfully as an alternative to an official integration of OCS into the mentioned applications.

Perhaps someone here can use this as food for thought.

Have fun with it and best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants