More PHP Source Code (Browser.php)

I’m in the process of Cleaning my php so that I can release the code into the wild ;)

I have 3 very small project I’d like to share, and they all have browser.php in them. It’s a small piece of code that allows the user/viewer to broswe a file system, and submit the selected files to another script.

I decided to realse this code separately because I’ve used it a couple of times and thought it’d be useful for others :)

As you can see by default the script submits to playlist.php and the list of file names sent is in an array called mpegs so I think enough of a clue to what my other projects might focus around !!! (FYI: The final thing the script sends is the PATH the files were found)

I’m hoping to get my first project finished tonight so watch this space :D

Cacti SNMP V3 Document Moves.

Grr , Some times I’m so indecisive I make myself cross (But I’m so angry I’m not sure ;-) )

I’ve moved my Cacti SNMP v3 Document into wordpress so that users/viewers can comment directly.

l8trz

Cacti. How to Enable SNMP v3 Polling.

Cacti SNMP v3 How-To (0.2)

Preface:

This document is intended to describe the process required to enable encrypted snmp polling within cacti. The document was written whilst performing the installation on a Linux Fedora Core 3 server, although implemntations on Fedora Core 1 & White Box Enterprise Linux have also been sucesful. The host used to gather data from for the purpose of this document is a Nokia IPSO appliance.

Limitations:

The version of cacti used will be 0.8.6b, “TheWitness” has told me that this version has a pooler crash, but I’ve yet to try upgrading to 8.8.6c.

System Requirements:

Apache, php, mysql, snmp, rrd-tool, and cacti ;-)

Installation:

I’m going to assume that you’ve got to the point where all of the parts needed for system requirements are working, cacti is installed, and you’ve just logged in after step 8 of http://www.cacti.net/downloads/docs/html/install_unix.html and was going to create a device.
  1. Log out ;-)
    Before we can create any snmp v3, we need to enable it; to enable snmp we need to make some changes to the php files.
  2. Change: ~/cacti_install_dir/lib/snmp.php.txt
    Line 46:

    • Change: $version = “1″;
    • to: $version = “3″;

    Line 65:

    • Change: $snmp_auth = “-u $username -X $password”; /* v3 – username/password */
    • to: $snmp_auth = “-u $username -A $password”; /* v3 – username/password */

    Line 119:

    • Change: $snmp_auth = “-u $username -X $password”; /* v3 – username/password */
    • to: $snmp_auth = “-u $username -A $password”; /* v3 – username/password */
  3. Change: ~/cacti_install_dir/include/config_form.php.txt
    Line 655:

    • Change: “method” => “hidden”
    • to: “method” => “textbox”

    Line 663:

    • Change: “method” => “hidden”
    • to: “method” => “textbox”
  4. Change: config_settings.php.txt
    Uncomment Line 186 -> 199, i.e. remove the “//” from the begining of each line.
  5. Change: config_array.php.txt
    Line 135:

    • Change:
      $snmp_versions = array(1 =>
      “Version 1″ ,
      “Version 2″ );
    • To:
      $snmp_versions = array(1 =>
      “Version 1″,
      “Version 2″,
      “Version 3″);
  6. Create /etc/snmp/snmp.conf
    The contents of the file should be:

    defContext “”
    defSecurityLevel authNoPriv

  7. Create Device
    As documented. http://www.cacti.net/downloads/docs/html/graph_howto.html#NEW_DEVICE
    (For Nokia IPSO Appliences use host Templaye Generic SNMP-enabled
    HOST, and Associated Data Queries: SNMP – Get Processor Infomation & SNMP -
    Interface Statistics )

    Screen Shot of creating a cacti device

  8. Create Graph

Appendix:

  • Rpms on my FC3 Machine
    $SHELL>rpm -qa | grep mysql
    mysql-3.23.58-14
    php-mysql-4.3.10-3.2
    mysql-server-3.23.58-14
    mysql-devel-3.23.58-14
    libdbi-dbd-mysql-0.6.5-9
    
    $SHELL> rpm -qa | grep php
    php-ldap-4.3.10-3.2
    php-mysql-4.3.10-3.2
    php-odbc-4.3.10-3.2
    php-4.3.10-3.2
    php-pear-4.3.10-3.2
    
    $SHELL> rpm -qa | grep http
    httpd-suexec-2.0.52-3.1
    system-config-httpd-1.3.1-1
    httpd-2.0.52-3.1
    httpd-manual-2.0.52-3.1
    
    $SHELL> rpm -qa | grep rrd
    rrdtool-1.0.49-3
    
    $SHELL> rpm -qa | grep snmp
    net-snmp-libs-5.1.2-11
    net-snmp-5.1.2-11
    net-snmp-utils-5.1.2-11
    
  • How to setup snmp v3 on IPSO
    (The is a quick guide of the steps needed)

    1. Log into Voyager
    2. Click Config
    3. Below the heading “Security and Access Configuration” Click Users
    4. Add a new user (Username , uid {eg. 110}, home {eg /var/uid}), Click Apply
    5. Set new users password , click apply
    6. CLick Home, config, snmp
    7. at the bottom of page set user to read-write

    to test from cacti server, try from shell, snmpwalk -u user -A password ,
    you should get….

    $SHELL>snmpwalk -u user -A password default_gw
    SNMPv2-MIB::sysDescr.0 = STRING: IP650 rev AAA06449-411, IPSO xxx 3.7.1-BUILD004 releng 1227 11.06.2003-010000 i386
    SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.94.1.21.2.1.8
    SNMPv2-MIB::sysUpTime.0 = Timeticks: (382157315) 44 days, 5:32:53.15
    SNMPv2-MIB::sysContact.0 = STRING: Me
    SNMPv2-MIB::sysName.0 = STRING: Nokia
    SNMPv2-MIB::sysLocation.0 = STRING: Here
    SNMPv2-MIB::sysServices.0 = INTEGER: 76
    SNMPv2-MIB::sysORLastChange.0 = Timeticks: (16) 0:00:00.16
    SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB

    SNMPv2-MIB::sysORID.2 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
    SNMPv2-MIB::sysORID.3 = OID: SNMP-MPD-MIB::snmpMPDCompliance
    SNMPv2-MIB::sysORID.4 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
    …….

    ChangeLog

    1. 16/3/2005 : [NICK] Doc Complete
    2. 17/3/2005 : [NICK] Doc Published on http://forums.cacti.net/
    3. 30/3/2005: [NICK] Doc moved into WordPress to allow viewers to comment directly

    END

    And I think that’s all folks, I hope it works for you & that you find this of some use !.

Check This ! readlist.com

I’ve been thinking about writing a php based mailing list reader for some time now, the idea being that I somehow read a mailing list, and re-publish it as an xml feed, that way “people” can read the lists without using valuable inbox space.

Anyway, someones done it for me, THANKS GUYS :D

check it yourself @ http://readlist.com/

XFCE Yum Repo For WBEL

UPDATE: 15th Aug 06 – This repo has moved, please see this post.

Yesterday I think google & I fell out, I’ve got WBEL installed on a really old PC and GNOME is just too fat :(

I discovered XFCE when I was playing with Fedora Core 2 some time ago. I found it to be a nice light weight windowmager / Desktop Evnvirmoent that used very little memory; so in my wisdom I decided to install XFCE onto my WBEL box, and to my suprise I couldn’t find a Yum Repo. This left me with three options (1) put up with twm (2) find another alternative, read their manual, and learn how to use xyz window manager or (3) Build XFCE for WBEL from source.

I chose (3): The great guys at xfce.org made my job very easy, on their site is whole load or src.rpms, so all i did was recomplie them (After playing a little chase the depandancy) and yum-arch the directory, I updated my yum.conf & Sorted xfce !

Instructions to install xfce here:http://www.linickx.com/index.php?content=whitebox

Advertising Apology

Advertsing, some people hate it, others it’s just mildy Annoying… Well I have the answer, yep, the 1st ever website where you the viewer can disable the ad’s for free !

Check the Advert Control Panel and disable the ad’s… cool. ;-)

I’ll be posting the code so other’s can enjoy this revelation; lets make advertising a choice, not a burden.

And the site goes Live !

So I’ve only gone and done it, joined the BLOG-bandwagon.

The questions is… Am I going to use it, or was it just more fun Hacking wordpress to make it “fit” my webiste ?

I’ll be using this BLOG & RSS feed to publish general rants & news about this site, I just hope it makes an interesting read ;)

l8trz