Search My Techie Guy

Ad from yllix

Monday, November 24, 2014

snmpwalk -v bash: snmpwalk: command not found yet Net-Snmp is successfully installed

I already have Net-Snmp installed on my server but couldn't run any snmp commands!

Problem:

# snmpwalk -v
bash: snmpwalk: command not found


Solution:

The problem is that the snmp binaries are not listed in my system's environment PATH!

# find / -name snmpwalk
/usr/sfw/bin/snmpwalk
/usr/local/bin/snmpwalk
/tmp/net-snmp-5.4.4/apps/.libs/snmpwalk
/tmp/net-snmp-5.4.4/apps/snmpwalk
/tmp/net-snmp-5.4.4/win32/snmpwalk


#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin

So i added the PATH "/usr/local/bin" to my system's environment PATH:

export PATH=$PATH:/usr/local/bin

#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/usr/local/bin

#snmpwalk -V
NET-SNMP version: 5.4.4


To make the environment PATH persistent through system restarts, follow these steps:

  • vi /etc/profile
Add this line at the bottom, depending on your system's suitable environment PATH:
  • PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/usr/local/bin
Run this command to update the system environment PATH:
  • source /etc/profile 
Test:
  •  #echo $PATH

ld.so.1: snmpwalk: fatal: libgcc_s.so.1: open failed: No such file or directory Killed

I had just finished installing net-snmp on one of my old DNS server to help me monitor it remotely using cacti but i ran into this error while trying to test it using snmpwalk.

Problem:

# snmpwalk -V
ld.so.1: snmpwalk: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed


Solution:

1. I ran a search to try and find this library, and yes libgcc was already installed on my server:

# find / -name libgcc*
/usr/local/lib/libgcc_s.so
/usr/local/lib/libgcc_s.so.1

2. So i checked my library PATH, and the path to libgcc wasn't there:

# echo $LD_LIBRARY_PATH
/usr/openwin/lib


3. I added it:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

4. Check again:

# echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/openwin/lib


5. Test snmpwalk again:

# snmpwalk -V
NET-SNMP version: 5.4.4

6. To make the library PATH persistent, do the following:
Edit the /etc/profile file:

  • vi /etc/profile
Add this line at the bottom, depending on your system's library PATH:
  • LD_LIBRARY_PATH=/usr/local/lib:/usr/openwin/lib
Run this command to update the system environment PATH:
  • source /etc/profile 
Test:
  •  #echo $LD_LIBRARY_PATH

Wednesday, November 19, 2014

One line script to list all the perl modules already installed on your server

Just copy and paste the command below into your command prompt:

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'

If used with grep, you can easily search through the list to confirm if your already have a certain perl module installed on your server or not! for example am looking for a Perl module named "Time::HiRes", so i run the command below:

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' | grep Time

/usr/lib64/perl5/Time/Piece.pm
/usr/lib64/perl5/Time/HiRes.pm
/usr/lib64/perl5/Time/Seconds.pm
/usr/share/perl5/Net/Time.pm
/usr/share/perl5/CPAN/FirstTime.pm
/usr/share/perl5/Time/Local.pm
/usr/share/perl5/Time/tm.pm
/usr/share/perl5/Time/localtime.pm
/usr/share/perl5/Time/gmtime.pm

Tuesday, November 18, 2014

How to gracefully restart unix/solaris server?

Telecommunication  applications system servers usually run critical applications that require graceful restart rather than just running a #reboot or #shutdown.
The command below will gracefully restart the server.

#sync;sync;sync;sync
#shutdown -y -g0 -i6

HUAWEI finally opens up their Knowledge Share with eNSP

HUAWEI, one of the giant telecom and ICT vendors and service provider has finally opened their knowledge share by launching a free graphical simulation tool called eNSP (Enterprise Network Simulation Platform).

The tools very much looks like CISCO's packet tracer with a graphical user interface, drag and drop and easy to use. Students, Specialist and Experts can now use this tool to get familiar with the Huawei OS environment. I wonder why it took Huawei all this time to come up with such a simple tool? but this is a sign that the Chinese are finally opening up to the global community because of the cut throat competition in the IT industry.
eNSP Huawei
Anyway, good move Huawei and the next step should be to also open up your certification exams just like CISCO and JUNIPER so someone can become a Huawei IP expert without having to first travel to Shenzhen, China.

The software is in it's beta version and you can download it from the Huawei Enterprise Support Community. Have fun and happy learning.

Monday, November 17, 2014

Print routing table - Add route - Del route - Unix - SunOS 5.10 - Example

Here is my server OS:
root@myserver# showrev 
Hostname: myserver
Hostid: 84623972
Release: 5.10
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain: 
Kernel version: SunOS 5.10 Generic_118833-23
root@myserver #

1. Display the current routing table:

root@myserver# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------

10.6.40.0            10.6.40.40           U         1   2747  bge0
10.6.40.0            10.6.40.60           UG        1      0  
192.168.199.0        10.6.40.60           UG        1   4783  
192.168.199.0        10.6.40.60           UG        1      0  
default              192.168.4.254       UG        1 128435  
127.0.0.1            127.0.0.1            UH        7   4277  lo0
root@myserver # 

2. Add the new route entry into the routing table:

root@myserver # route add -net 172.27.97.0 -netmask 255.255.255.0 10.6.40.60
add net 172.27.97.0: gateway 10.6.40.60
root@myserver #

3. Print the new routing table again to comfirm entry:

root@myserver# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------

10.6.40.0            10.6.40.40           U         1   2747  bge0
10.6.40.0            10.6.40.60           UG        1      0  
192.168.199.0        10.6.40.60           UG        1   4783  
192.168.199.0        10.6.40.60           UG        1      0  
172.27.97.0          10.6.40.60           UG        1      1 
default              192.168.4.254       UG        1 128435  
127.0.0.1            127.0.0.1            UH        7   4277  lo0
root@myserver # 

4. And if you need to delete the route entry:

root@myserver #route delete -net 172.27.97.0 -netmask 255.255.255.0 10.6.40.60
delete net 172.27.97.0: gateway 10.6.40.61

5. Print the routing table again to confirm that it has been deleted:

root@myserver# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------

10.6.40.0            10.6.40.40           U         1   2747  bge0
10.6.40.0            10.6.40.60           UG        1      0  
192.168.199.0        10.6.40.60           UG        1   4783  
192.168.199.0        10.6.40.60           UG        1      0  
default              192.168.4.254       UG        1 128435  
127.0.0.1            127.0.0.1            UH        7   4277  lo0
root@myserver # 

Monday, November 10, 2014

Internet Modem (Dongle) - The SIM/USIM card has not been detected or is invalid

My Airtel Uganda internet dongle has been acting up; Sometimes it would connect without a problem and on some occasions it would give me the error below:
The SIM/USIM card has not been detected or is invalid
Most probably the SIM card is faulty.

Solution: SIM SWAP
Go to the nearest service center and request for a SIM Swap. That should sort out this error.

What is the meaning of "Overdrive (O/D) OFF"? - Automatic Transmission Cars

I have been asked this question over and over again by owners of automatic transmission cars. Myself , i love the manual transmission cars (also know as "stick shift") and this term "overdrive OFF" may not be applicable to the manual cars as you will later find out in this brief article.

Am not going to be too technical and am going to be brief and precise, so i hope this speaks to the layman and immediately clears your doubts about the "O/D OFF" indicator on your car dashboard.

so what is O/D?
O/D simply stands for Overdrive

There are two important components of the O/D that you need to know:

1. The O/D main switch - This is a small button located on the gear selector of your car.
O/D main switch
2. The "O/D OFF" indicator light - The umber light that shows up on the dashboard when the O/D main switch is in OFF position.
O/D OFF indicator light
So here comes the big questions; what does O/D do? When do i need it? what is the default position of the O/D switch? 
Like i promised, the answer is short and precise.

Overdrive allows the car to operate in the highest gear in the transmission (Usually gear #5 or gear #4 for cars that only have 4 gears). This allows the vehicle to achieve better fuel efficiency, and often quieter operation on the highway. When O/D is OFF, the automatic transmission shifting is limited to the lower gears (gears #1, #2 & #3).

By default, "O/D is ON"; That's the O/D switch button is pressed and the O/D indicator light on the dashboard is NOT showing (means O/D ON).
"O/D is OFF" when the O/D switch button is released and the O/D indicator light on the dashboard is lighting.
O/D switch positions
You need "O/D ON" if; you are on a highway and driving at higher speeds, usually above 70 km/h. (allows the car to operate at higher gears and this is friendly to the engine and is fuel efficient).

You need "O/D OFF" if; you are on a bad road, going up a hill, carrying a heavy load, driving in slow city traffic, going down the hill and you need engine braking, or if you need quick acceleration for example during an overtake.

If you have any questions about the O/D function, feel free to comment below, otherwise happy driving :-)