Discussion:
Redhat extend MIB getting the information into zenoss
ds_01
2013-09-13 13:18:16 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74638#74638

--------------------------------------------------------------
So we are using the Redhat extend MIB extensively accross many hosts here and you can query SNMP using SNMP walk or get succesfully to return meaningful information.

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html

I'm quite new to Zenoss and struggling a bit.

So I'm trying to add OIDs using a local template for my workstation only (this is on a test server with a limited number of discovered hosts).

I add the data source and add the OID. In this case the information is a test string - its value is for information only (it is not part of a critial altert etc).

There is then a Data point - but I'm not sure how to configure this as it is a string value.

Ultimately I'm looking to build a report where one column is Device name and the other is the result of the SNMP query for that OID. This would be for all hosts.

thanks for any pointers
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74638#74638]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2013-09-13 14:00:07 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74633#74633

--------------------------------------------------------------
Zenoss only supports integer values from SNMP OIDs.

--
James Pulver
ZCA Member
CLASSE Computer Group
Cornell University
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74633#74633]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-13 14:02:31 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74639#74639

--------------------------------------------------------------
Ok thanks for clarifying...

So can I do something like this below somehow?    On each host of course

/bin/cat  /var/tmp/snmp/data_in_text_file
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74639#74639]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2013-09-13 14:08:54 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74634#74634

--------------------------------------------------------------
Umm, I would guess so, you'd need to use SSH monitoring. Or you could look at this brand new zenpack from the community and see if it helps:
View the full discussion (http://community.zenoss.org/message/74630#74630)
--
James Pulver
ZCA Member
CLASSE Computer Group
Cornell University
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74634#74634]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-13 14:53:19 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74640#74640

--------------------------------------------------------------
It seems like it might be possible to do this using a Nagious plugin. I've not written one before though.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74640#74640]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-13 14:54:33 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74641#74641

--------------------------------------------------------------
or a "script in nagious format" ...
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74641#74641]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2013-09-13 16:21:33 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74642#74642

--------------------------------------------------------------
Well if the data you are getting is from Extending the Red Hat MIB, then you should have control over the script.  If the script returns a string that can only have a list of possible values, you can instead return a numerical index.  Many systems do this, where they will return for example a status number from 0 to 3, where 0 is ok, 1 is warning, 2 is critical, and 3 is unknown.

Also you can do a command script that will query your Extended OID and do whatever logic is needed.

I.E.

#!/bin/bash

TheVer=$1
TheCom=$2
TheIP=$3
TheOID=$4

TheCheck =`snmpget -"$TheVer" -c"$TheCom" "$TheIP" "$TheOID" | awk -F 'STRING: ' '{print $2}' | sed 's/"//g'`

the call would look like this in a command template:

<your scritp here> ${dev/zSnmpVer} ${dev/zSnmpCommunity} ${dev/manageIp} .1.3.6.x.x.x.x.x.x <- your OID

* $TheCheck now holds your string value, the rest of your script can do any logic you need, then return the result in nagios format.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74642#74642]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-16 15:03:21 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74668#74668

--------------------------------------------------------------
Thanks for the reply

I'm making a bit of progress..

I've added this zenpack on the zenoss test server

ZenPacks.skills1st.snmpExtend

  A ZenPack that works with the NET-SNMP-EXTEND-MIB which runs operating system commands when queried.
  https://github.com/jcurry/ZenPacks.skills1st.snmpExtend https://github.com/jcurry/ZenPacks.skills1st.snmpExtend
  https://github.com/jcurry/ZenPacks.skills1st.snmpExtend/downloads https://github.com/jcurry/ZenPacks.skills1st.snmpExtend/downloads


It looked like when I modeled against a specific host that it was working (as in it returned some info via snmp).. just need to get it into reports now ..

Though I don't need to do this right now/... I'd still like to get a test script working over ssh (in nagious format).. which simply doesn't   /bin/cat  /some/random/files getting file not found when I did this using the gui (No such file or directory)

My options for the data source were

enabled [ticked]
ssh [ticked],
Parser: Auto
Severity: Info
Command template: test.sh   (resides in libexec dir)
Event Class: /Status

*test.sh*
#!/bin/sh
# Nagios return codes
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
exitstatus=$STATE_OK
/bin/cat /var/tmp/snmp/cfenginemode
exit $exitstatus
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74668#74668]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-16 15:12:24 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74669#74669

--------------------------------------------------------------
Gui is a problem then...  ( http://community.zenoss.org/thread/19682 http://community.zenoss.org/thread/19682)

I did a

zencommand run -d +host+ -v10

and got

2013-09-16 11:08:27,391 WARNING zen.zencommand: zCommandUsername is not set for +host+

Should be doing this passwordless though? As I have already specified a zKeyPath (in configuration properties)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74669#74669]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-16 16:26:27 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74670#74670

--------------------------------------------------------------
Getting there... it should connect if i sort out SELINUX on the hosts its connecting to ... suspect label is wrong on the authorized key file...

So I should be able to connect with zenoss soon.. I'll post the outcome when I've had a go

thanks
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74670#74670]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2013-09-16 16:37:22 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74661#74661

--------------------------------------------------------------
If you want extended MIB scripts to run with root privileges (I ran into that with my script to check software RAIDs), you have to edit the sudoers file on the machine that will run the script.

add this at the end of the sudoers file

snmp     ALL=(ALL)     NOPASSWD:     ALL

then if your script has commands that need root privileges, you should be good to go.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74661#74661]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-17 09:42:07 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74682#74682

--------------------------------------------------------------
I may sound like I'm talking to myself but hopefully this will help someone else ;) As I know sometimes it can be difficult to find information.....


Right so I've got this working now (Zenoss executing script on client over ssh)....

I've had to isable SELINUX for now on the workstation client it is fetching the data from on. The label is wrong or something on the workstations's authorized keys file for the zenoss user I'm connecting as (from the server).

On the workstation:

I've got a file in /var/tmp/snmp/ on the workstation that contains just one word "TestMode" at the moment. We populate such files with meaningful data once per hour using cfengine.



Zenoss calls this from /usr/local/bin/script.sh which looks like this:

#!/bin/bash
/bin/cat /var/tmp/snmp/file



This is defined in zenoss as a local template on the device.

Data Sources > Edit Data Source > menu appears

Use SSH: ticked
TYPE: command
Command template is the full path to the script to return the data on the workstation   /usr/local/bin/script.sh
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74682#74682]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jcurry
2013-09-17 13:06:30 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74678#74678

--------------------------------------------------------------
Glad that my ZenPacks.skills1st.snmpExtend zenpack gave you some pointers.  You may have most of what you want now but Serge has just created the ZenPacks.ssv.SubagentShell ZenPack - see http://community.zenoss.org/docs/DOC-13937 http://community.zenoss.org/docs/DOC-13937 .

So far I have installed it and just used the dfault stuff but it looks like it has terrific potential and should be more useful and extensive than my little sample with the extend MIB.  It uses an agentx subagent.

Cheers,
Jane
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74678#74678]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-17 13:39:28 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74684#74684

--------------------------------------------------------------
Hi

Yes thanks the zenpack appears to be what I'm after.

But I'm abit confused with the big picture at the moment - I'm trying to create a custom report.

My first column is titleOrId, 2nd colum will be a custom column (from the extend information). This custom column will be using data acquired from a modeller plugin provided in that zenpack.

How do I start to determine what the column name will be or how to create it if its not there? Unfortunately right now I don't even know where to start looking to achieve this!

I was reading this http://community.zenoss.org/docs/DOC-12006 http://community.zenoss.org/docs/DOC-12006/version/3  but the columns mentioned are standard/built-in. In this example it just basically uses pre-existing expressions from a list. I find that example doesn't go far enough - I would imagine a lot of users at some point will end up wanting a custom report most likely involving a custom column.

thanks
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74684#74684]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ds_01
2013-09-17 15:27:06 UTC
Permalink
ds_01 [http://community.zenoss.org/people/ds_01] created the discussion

"Re: Redhat extend MIB getting the information into zenoss"

To view the discussion, visit: http://community.zenoss.org/message/74687#74687

--------------------------------------------------------------
Ah sorry it appears the zenpack has installed the necessary report.

I'll have to see if I can understand what is going on....
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74687#74687]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...