Discussion:
Monitoring filesizes in Zenoss 4.2
Lumskekonig
2012-11-18 11:20:08 UTC
Permalink
Lumskekonig [http://community.zenoss.org/people/Lumskekonig] created the discussion

"Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
Hi.

I was wondering if/how it is possible to monitor specific filesizes in Zenoss 4.2

I am looking to monitor:
- Specific files in a folder
- All files in a specific folder and subfolders
- one specific file


Thank you in advance
Lumskekonig
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Lumskekonig
2012-11-19 12:19:03 UTC
Permalink
Lumskekonig [http://community.zenoss.org/people/Lumskekonig] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
Forgot to mention that it is both windows and linux i'm looking to monitor filesizes on?
Hope anyone can help me.
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
j053ph4
2012-11-20 20:44:06 UTC
Permalink
j053ph4 [http://community.zenoss.org/people/j053ph4] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
You'll probably have to write a custom script to do this for you.  If you're up for modifying one, i have a shell script that i used to use for monitoring IBM MQ queue size on both Windows and UNIX boxes.  You'll need to modify it pretty substantially for your use, but the script works against both Windows (via winexe) and Unix (via ssh) boxes.  On some 2003 and 2008 servers, the winexe has to be added manually as a service before it will work correctly, which can be done with the following 2 commands (command prompt):

*sc create winexesvc binPath= WINEXESVC.EXE start= auto DisplayName= winexesvc*
*sc description winexesvc "Remote command provider for Zenoss monitoring"*

Additionally, here is the script I mentioned:

*#!/bin/bash*
*###################################*
*#*
*#       mq-currqueue.sh*
*#*
*#        return MQ queue depth for given queue*
*#       *
*#        Author:  Joseph Anderson*
*#        Version:  1.0*
*#        Released:  Feb 5, 2009*
*#*
*###################################*

*# input parameters*
*# remote host*
*MQHOST=$1;*
*# OS type ("unix" or "windows")*
*OSTYPE=$2;*
*# queue name*
*QUEUENAME=$3;*
*QUEUEMANAGER=$4;*

*WINRUNMQBIN="runmqsc.exe"*
*RUNMQBIN="/usr/bin/runmqsc"*
*WINEXE="/opt/zenoss/bin/winexe"*


*# if windows, win auth*
*if [[ $OSTYPE = "windows" ]] ; then*
*    # like "domain/user%password"*
*    WINAUTH=$5;*
*fi*

*###################################*
*#       Name: Main*
*#       Purpose: Execute Code*
*###################################*
*doMain() {*
*    # first check OS type to determine which test to execute*
*    if [[ $OSTYPE = "windows" ]] ; then*
*        queueval=$(checkWinMqQueue $MQHOST "$QUEUENAME" $WINAUTH;)*
*    else*
*        queueval=$(checkMqQueue $MQHOST "$QUEUENAME")*
*    fi   *
*    # output queue name, and current depth*
*    printf "$QUEUENAME OK|currqueue=$queueval\n"*
*    exit 0*
*}*

*###################################*
*#       Name: checkMqQueue*
*#       Purpose: check MQ Queue*
*###################################*
*checkMqQueue() {*
*    MQHOST=$1;*
*    QUEUENAME=$2;*
*    QUERY=$(cat <<EOD*
*DISPLAY queue($QUEUENAME) TYPE(QLOCAL) CURDEPTH*
*EOD)*
*    RMTCMD="su - mqm -c \"echo 'DISPLAY queue(${QUEUENAME}) TYPE(QLOCAL) CURDEPTH' | /usr/bin/runmqsc $QUEUEMANAGER\""*
*    RUNCOMMAND=$(sshCommand $MQHOST "$RMTCMD" | grep 'CURDEPTH(' | sed 's/^ *//g' | sed 's/ *$//g' )   *
*    OUTPUT=$(echo $RUNCOMMAND  | awk '{print $2}' | cut -f 2 -d '(' | cut -f 1 -d ')')*
*    echo $OUTPUT*
*}*

*###################################*
*#       Name: checkWinMqQueue*
*#       Purpose: check MQ Queue*
*###################################*
*checkWinMqQueue() {*
*    MQHOST=$1;*
*    QUEUENAME=$2;*
*    WINAUTH=$3;*
*    # check queue size*
*    QUERY=$(cat <<EOD*
*DISPLAY queue($QUEUENAME) TYPE(QLOCAL) CURDEPTH*
*END*
*EOD)*

*    #RUNCOMMAND=$(echo "$QUERY" | winCommand "$MQHOST" "$WINAUTH" "$WINRUNMQBIN $QUEUEMANAGER"| grep 'CURDEPTH(' )*
*    RUNCOMMAND=$(echo "$QUERY" | winCommand "$MQHOST" "$WINAUTH" "$WINRUNMQBIN $QUEUEMANAGER"| grep 'CURDEPTH('  | sed 's/^ *//g' | sed 's/ *$//g' )*

*    OUTPUT=$(echo $RUNCOMMAND  | awk '{print $1}' | cut -f 2 -d '(' | cut -f 1 -d ')')*
*    echo $OUTPUT*
*}*


*###################################*
*#    Name: sshCommand*
*#    Purpose: execute ssh command*
*###################################*
*sshCommand(){*
*    HOST="$1";*
*    COMMAND="$2";*
*    ssh -q -T root@$HOST "$COMMAND"   *
*}*

*###################################*
*#    Name: winCommand*
*#    Purpose: execute ssh command*
*###################################*
*winCommand(){*
*    HOST="$1";*
*    AUTH="$2"; #domain/user%password  FOR ZENOSS: ${here/zWinUser}%${here/zWinPassword}*
*    COMMAND="$3";*
*    $WINEXE -U "$AUTH" //"$HOST" "$COMMAND"*
*}*

*doMain;*


Like I said, this will probably require a bit of work on your side to suit your purposes, but the good thing about it is the ability to run against Windows or Unix via runtime arguments.

Hope this helps,
Joseph
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Lumskekonig
2012-11-22 11:14:53 UTC
Permalink
Lumskekonig [http://community.zenoss.org/people/Lumskekonig] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
Hi Joseph.

Thank you very much for that reply, but rather than using a script to monitor i would rather do it over WMI and SSH.

Wit the old WMI data source it was no problem to monitor windows file size's just add a Query:
*SELECT FileSize FROM CIM_DataFile WHERE Drive="+c:+" AND Path="+\\windows\\system32\\+" AND Extension="+dll+".*

But since they have changed to winperf, i cant figure out how.

And linux over SSH you run the desired linux commands, but i dont see an option for adding af SSH datasource anymore?

Best Regards
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2012-11-28 17:01:12 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
WinPerf doesn't use WMI, which is your issue. It uses Perfmon. What you need to do is look at Egor's WMI pack on github, OR write a command datasource using wmic...

--
James Pulver
ZCA Member
LEPP 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/70202#70202]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Lumskekonig
2012-11-30 09:40:28 UTC
Permalink
Lumskekonig [http://community.zenoss.org/people/Lumskekonig] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
Hi Jamens.

WMIC! why the heck did i not think of that.

How would you create a data source with datapoints to check for filesize through WMIC?
( the WMIC command could be: +wmic datafile where "Drive='C:' AND path='\\Windows\\' AND extension='dat'" get name,FileSize+ )

Thanks in advance
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2012-12-03 14:31:09 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
For that you would use a command datasource, and create the command as you're showing, probably using zwinuser and zwinpassword z properties to authenticate...

--
James Pulver
ZCA Member
LEPP 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/70287#70287]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Lumskekonig
2012-12-04 19:06:20 UTC
Permalink
Lumskekonig [http://community.zenoss.org/people/Lumskekonig] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
Do you use winexe for this part or how do you specify zwinpassword and user in a command data source?

Thanks in advance.
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2012-12-04 20:09:46 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Monitoring filesizes in Zenoss 4.2"

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

--------------------------------------------------------------
As shown in the above example post *in this thread*!, ${here/zWinUser} and ${here/zWinPassword} will put the appropriate zProperty into the command youy are calling.

--
James Pulver
ZCA Member
LEPP 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/70328#70328]

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