Testing Newrelic on Ubuntu Server

I have chance to try newrelic software. Its advance monitoring service and analysis in one place.

As they said “application performance management and monitoring”.

After sign up for free account I continue to deploy it on Ubuntu server (most of my server use freeBSD but I prefer to try it on Linux based system first).

The process is easy and straightforward as you can see from the picture :

newrelic1

 

The only problem is PHP version since I downgrade it for compatible issue.

# php -v
PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Continue

# wget -O - http://download.newrelic.com/548C16BF.gpg | apt-key add -

# nano /etc/apt/sources.list.d/newrelic.list

enter these line :

deb http://apt.newrelic.com/debian/ newrelic non-free

deploy newrelic agent:

# apt-get update

# apt-get install newrelic-php5

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
newrelic-daemon newrelic-php5-common
The following NEW packages will be installed:
newrelic-daemon newrelic-php5 newrelic-php5-common
0 upgraded, 3 newly installed, 0 to remove and 124 not upgraded.
Need to get 12.2 MB of archives.
After this operation, 31.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

# newrelic-install install

new screen will show up

New Relic PHP Agent Installation (interactive mode)
===================================================
In order for the New Relic agent to function correctly it requires a license
key. Please enter that key now. If you do not have your license key handy you
can add it to your INI file(s) later. Please be aware that the license key you
specify here will be installed in the default INI files, and will be the key
used for any virtual host or directory / application that does not over-ride
the key on a per-host or per-directory basis. This is only relevant if you run
a multi-tenant site. Please contact [email protected] if you run such a
site and have any questions.

If you are upgrading from a previous version please leave this blank. Please
also note that the key you enter here will not replace any existing key in
your INI file(s). It applies only to newly created INI files or INI files that
have not been modified by this script before.

Enter New Relic license key (or leave blank):

Just follow on screen guide.

Then you’ll see this message :

New Relic is now installed on your system. Congratulations!

The last step before you will start seeing data in your account is to restart
your web server or servers, or whatever environment hosts the PHP you wish to
monitor. For example, you may need to restart Apache or nginx, or if you are
using php-fpm and FastCGI, you will need to restart php-fpm. If you installed
New Relic into multiple locations you may have multiple PHP hosts to restart.
If everything is working properly you should see the following two log files:

/var/log/newrelic/newrelic-daemon.log
/var/log/newrelic/php_agent.log

Now you should create a simple test php script that contains the line:

<?php phpinfo(); ?>

and point your browser at the test script, and you should see the New Relic
extension and its settings. If you still do not see those log files or data in
your account please contact our support staff at [email protected] and be
sure to include the following file in your bug report:

/tmp/nrinstall-20130420-105849-26070.tar

Thank you for choosing New Relic!

Checking log presence :

# ls -l /var/log/newrelic | grep log

-rw-rw-rw- 1 root root 997 2013-04-20 11:02 newrelic-daemon.log
-rw-r–r– 1 root root 3303 2013-04-20 11:01 php_agent.log

Yes,log file is exist.

newrelic2

 

phpinfo() also show information about newrelic.

My newrelic dashboard now give many information :

newrelic3

 

Wow, impressive report and many more.

 

Upgrade FreeBSD and The ‘pw’ command exited with unexpected status 74

I have a vps account and got problem with pw  and also from sysinstall  after upgrade FreeBSD from 8.2 to 8.3.

# uname -a
FreeBSD alamsyah-rasyid.cust.arpnetworks.com 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64

# freebsd-update upgrade -r 8.3-RELEASE

….6680….6690….6700….6710….6720….6730….6740….6750….6760….6770….6780….6790….6800….6810….6820….6830….6840….6850….6860….6870….6880….6890….6900….6910….6920….6930….6940….6950….6960….6970….6980….6990….7000….7010….7020….7030….7040….7050….7060….7070….7080….7090….7100….7110….7120….7130….7140….7150….7160….7170….7180….7190….7200….7210….7220….7230….7240….7250….7260….7270….7280….7290….7300….7310….7320….7330….7340….7350….7360….7370….7380….7390….7400….7410….7420….7430….7440….7450….7460….7470….7480….7490….7500….7510….7520….7530….7540….7550….7560….7570….7580….7590….7600….7610….7620….7630….7640….7650….7660….7670….7680….7690….7700….7710….7720….7730….7740….7750….7760….7770….7780….7790….7800….7810….7820….7830….7840….7850….7860….7870….7880….7890….7900….7910….7920….7930….7940….7950….7960….7970….7980….7990….8000….8010….8020….8030….8040….8050….8060….8070….8080….8090….8100….8110….8120….8130….8140….8150….8160….8170….8180….8190….8200….8210….8220….8230….8240….8250….8260… done.
Applying patches…

# The following changes, which occurred between FreeBSD 8.2-RELEASE and
FreeBSD 8.3-RELEASE have been merged into /etc/group:
— current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: src/etc/group,v 1.35.10.1.6.1 2010/12/21 17:09:25 kensmith Exp $
+# $FreeBSD: src/etc/group,v 1.35.10.2.2.1 2012/03/03 06:15:13 kensmith Exp $

you should check this file and see if tis fit your setting.

Mergemaster work as expected and time for freebsd-update install.
# freebsd-update install
Installing updates…
Kernel updates have been installed. Please reboot and run
“/usr/sbin/freebsd-update install” again to finish installing updates.

After restart the machine I need to add new account but got this error :

The ‘pw’ command exited with unexpected status 74

Further search lead me to this command  :

cd /etc && pwd_mkdb -p master.passwd

This command work well and solve my problem.

in Unix | 177 Words

Find out which lan card device is active

I used to work with FreeBSD till I resign after working for 10 years. Not touch server for long time make bit nervous when a client ask me to install and configure new server using various OS but mainly still in Linux or BSD environment.

When client change lan card position or change rj45 location system will get error message and not working.

Identify lan card and its ip address in Linux

# ifconfig -a | more

eth0 Link encap:Ethernet HWaddr 00:21:5e:6b:f6:76
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:91a80000-91aa0000

eth1 Link encap:Ethernet HWaddr 00:21:5e:6b:f6:77
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:5eff:fe6b:f677/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4607 errors:0 dropped:0 overruns:0 frame:0
TX packets:7707 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:394554 (394.5 KB) TX bytes:10255745 (10.2 MB)
Memory:91980000-919a0000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:226 errors:0 dropped:0 overruns:0 frame:0
TX packets:226 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36231 (36.2 KB) TX bytes:36231 (36.2 KB)

usb0 Link encap:Ethernet HWaddr 02:21:5e:6b:f6:79
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

# ifconfig -s
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth1 1500 0 4627 0 0 0 7724 0 0 0 BMRU
lo 16436 0 226 0 0 0 226 0 0 0 LRU

How about FreeBSD??

# ifconfig -a
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:16:3e:9f:46:a1
inet 216.24.200.111 netmask 0xfffffff8 broadcast 216.24.200.199
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000

another FreeBSD machine

$ ifconfig -a
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
ether 5c:f3:fc:2a:53:35
inet 118.97.168.200 netmask 0xffffff00 broadcast 118.97.168.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
ether 5c:f3:fc:2a:53:36
inet 10.36.2.9 netmask 0xffffff00 broadcast 10.36.2.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
nd6 options=3<PERFORMNUD,ACCEPT_RTADV>

Message from this post :

1. use ifconfig -s in linux to check which lan card device connected with cable.

2. See status in FreeBSD to check which lan card connected with lan cable.

in Unix | 480 Words

Cisco SMARTnet and Hardware Replacement

Actually this is an old case in which the Cisco 2800 router that is suddenly broken at the office and all the efforts that we know have been carried out but the router still can not walk properly.

Local checks be done and recommendations can be given is to resend to the nearest dealer for replacement of the goods with new goods. 100% new.

How can this be done?
SMARTnet is the answer, quote from cisco site:

“SMARTnet Gives your IT staff direct, anytime access to Cisco engineers, the Technical Assistance Center (TAC), and an extensive range of online resources. You receive fast, expert technical support, flexible hardware coverage, and smart, personalized capabilities to help you resolve critical network issues. ”

This was indeed true, in the case of faulty hardware router we replaced our router with a new router. Here’s the process sequence:

1. Contact email address [email protected]
2. Provide the following information in your email:
– No SMARTnet contracts
– Types of router
– Problems occurred
3. Our email reply within 6 hours by a TAC angineer which is dedicated specifically to the problems that we ask.
4. Case is opened and all the history will note there a solution.simply note the case number provided.
5. At this stage all the help of Cisco’s support will be provided either through the guidelines that we must type the command (if the instrument is still able to live up to the remote support). If the machine can live and work well then the case is closed.

In the case of the death total tool then some questions will be posed, the results of this question becomes a reference for the provision of new hardware with the RMA code.

Address details of contact persons associated with this router cisco will be asked by the parties, then a replacement item will be shipped within 1-2 days and will be able to accept. After this replacement tool and can work to replace the damaged device then our task then is to send us the damaged goods to a courier who had been appointed by cisco.

The process can be monitored simply by contacting the logistics or the Asset Recovery department to include the RMA code provided by Cisco. Filling the form will be asked to fill customer satisfaction by the Cisco after all this process is completed properly. In the case that we experienced the time it takes to get the tools and the resolution of all cases only takes 5 days. Our response to this SMARTnet service is exceptional and very professional.

Lessons from this case is if possible to get service Cisco SMARTnet on any device you have. Investments at cost of purchase and this warranty will provide added value and confidence plus for us consumers.

Info: not all resellers Cisco SMARTnet support this, make sure you ask them to make sure you get the best service.

Sender address rejected: Domain not found

I have an order for reinstall email server. I accept the job and finish it in one day ( I use FreeBSD 8.2 release for OS and Postfix for MTA but the longest session during reinstall is backup and migrating mailbox).

Everything seem ok until mail server deployed, local delivery work well except sending to outside. Any email to other email server rejected with ‘domain not found’ message.

I’ve change /etc/resolv.conf to use opendns and google public ip but still not work, the error message still appear and make me little confuse.

After look around finally I got the solution. Its about postfix local resolv.conf file. Postfix has its own resolv.conf file located in /var/spool/postfix/etc.

mail# ls
hosts           localtime       resolv.conf     services

Yes, that resolv.conf file is still holding the value of local dns server I use during installation process.

Change the ip to isp dns server clear my problem and everything seem fine.

Time to set spf record and dkim.

See you.

in Unix | 169 Words