Popular Posts

Sunday 27 August 2017

mechanical interview questions

Image result for interview questions mechanical

1.What are the different types of fits? Explain?

On the basis of Indian standards fits can mainly be categorized into three groups:
> Clearance Fit: These types of fits are characterized by the occurrence of a clearance between the two mating parts. The difference between the minimum size of the hole and the maximum size of the shaft is called the minimum clearance, the difference between the maximum size of the hole and the minimum size of the shaft is known as maximum clearance.
> Interference Fit: In these types of fits the size of the mating parts are predefined so that interference between them always occurs. The tolerance zone of the hole is completely below the tolerance zone of the shaft.
> Transition Fit: As the name suggests these type of fit has its mating parts sized limited to allow either clearance or interference. The tolerance zone of the hole and the shaft overlaps in case of such fits.
For a shaft designated as 40 H8/f7, calculate the tolerances.
Given: Shaft designation = 40 H8/f7
The shaft designation 40 H8/f 7 means that the basic size is 40 mm and the tolerance grade for
the hole is 8 ( i. e. I T 8) and for the shaft is 7 ( i. e. I T 7).
Since 40 mm lies in the diameter steps of 30 to 50 mm, therefore the geometric mean diameter,
D = Square root of (30 x 50) = 38.73 mm
We know that standard tolerance unit,
i = 0.45 x Cube root of (D) + 0.001 D
i = 0.45 × 3.38 + 0.03873 = 1.559 73 or 1.56 microns
i = 1.56 × 0.001 = 0.001 56 mm ...(1 micron = 0.001 mm)
The standard tolerance for the hole of grade 8 (IT8)
= 25 i = 25 × 0.001 56 = 0.039 mm
The standard tolerance for the shaft of grade 7 (IT7)
= 16 i = 16 × 0.001 56 = 0.025 mm

2.What are the factors that can affect the Factor of safety selection?

The factor of safety is used in designing a machine component. Prior to selecting the correct factor of safety certain points must be taken into consideration such as:
> The properties of the material used for the machine and the changes in its intrinsic properties over the time period of service.
> The accuracy and authenticity of test results to the actual machine parts.
> The applied load reliability.
> The limit of stresses (localized).
> The loss of property and life in case of failures.
> The limit of initial stresses at the time period of manufacture.
> The extent to which the assumptions can be simplified.

The factor of safety also depends on numerous other considerations such as the material, the method of manufacturing , the various types of stress, the part shapes etc.

3.What is heat treatment and why is it done?

Heat treatment can be defined as a combination of processes or operations in which the heating and cooling of a metal or alloy is done in order to obtain desirable characteristics without changing the compositions. Some of the motives or purpose of heat treatment are as follows:
> In order to improve the hardness of metals.
> For the softening of the metal.
> In order to improve the machinability of the metal.
> To change the grain size.
> To provide better resistance to heat, corrosion, wear etc.
Heat treatment is generally performed in the following ways:
> Normalizing
> Annealing
> Spheroidising
> Hardening
> Tempering
> Surface or case hardening

4.What are the rules that must be kept in mind while designing castings?

Some of the points that must be kept in mind during the process of cast designing are as follows:
> To avoid the concentration of stresses sharp corners and frequent use of fillets should be avoided.
> Section thicknesses should be uniform as much as possible. For variations it must be done gradually.
> Abrupt changes in the thickness should be avoided at all costs.
> Simplicity is the key, the casting should be designed as simple as possible.
> It is difficult to create true large spaces and henceforth large flat surfaces must be avoided.
> Webs and ribs used for stiffening in castings should as minimal as possible.
> Curved shapes can be used in order to improve the stress handling of the cast.

5.What are the points that should be kept in mind during forging design?

Some of the points that should be followed while forging design are:
> A radial flow of grains or fibers must be achieved in the forged components.
> The forged items such as drop and press forgings should have a parting line that should divide the forging into two equal halves.
> The ribs in a forging should not be high or thin.
> In order to avoid increased die wear the pockets and recesses in forgings should be minimum.
> In forgings the parting line of it should lie as far as possible in a single plane.
> For ease of forging and easy removal of forgings the surfaces of the metal should contain sufficient drafts.

6.Describe briefly the different cold drawing processes.

Some of the important cold drawing processes are as follows:
> Bar and Rod Drawing: In the case of bar drawing the hot drawn bars are at first pickled, washed and coated to prevent oxidation. Once this is done a draw bench is used for the process of cold drawing. In order to make an end possible to enter a drawing die the diameter of the rod is reduced by the swaging operation. This end is fastened by chains to the draw bench and the end is gripped by the jaws of the carriage. In this method a high surface finish and accuracy dimensionally is obtained. The products of this process can be used directly without any further machining.
> Wire Drawing: Similar to the above process the bars are first pickled, washed and coated to prevent any oxidation. After this the rods are passed through several dies of decreasing diameter to provide a desired reduction in the size ( diameter ). The dies used for the reduction process is generally made up of carbide materials.
>Tube Drawing: This type of drawing is very similar to the bar drawing process and in majority of cases it is accomplished by the use of a draw bench.

7.What are the different theories of failure under static load, explain briefly?


The main theories of failure of a member subjected to bi-axial stress are as follows:
> Maximum principal stress theory ( Rankine’s theory): This theory states that failure occurs at a point in member where the maximum principal or normal stress in a bi-axial system reaches the maximum strength in a simple tension test.
> Maximum shear stress theory ( Guest’s or Tresca’s theory): This theory states that failure occurs when the biaxial stress reaches a value equal to the shear stress at yield point in a simple tension test.
> Maximum principal strain theory ( Saint Venant theory): This theory states that failure occurs when bi-axial stress reaches the limiting value of strain.
> Maximum strain energy theory ( Haigh’s theory): This theory states that failure occurs when strain energy per unit volume of the stress system reaches the limiting strain energy point.
> Maximum distortion energy theory ( Hencky and Von Mises theory): This theory states that failure occurs when strain energy per unit volume reaches the limiting distortion energy.

Interview questions by HR

HR Questions about Candidate

Hello, how are you today ?

This is more of a “make yourself comfortable” statements. Answer with a pleasant smile. If you had any trouble during the day, don’t hesitate to mention it. But make sure you express it in a positive note.
Examples:
  • “I am very well today sir, thank you”.
  • “I am very well today sir, just that the traffic here is bit of a hassle. But I made sure, I start a bit early to beat it.”


Tell me about yourself.

The FIRST & BEST question for any HR interview. The answer to this basically sets the tone of rest of the interview. Good news is – You can earn a lot of points if this is answered right.
  • Give a brief of your education background (up to plus two is fine, your family and location, any of your hobbies etc.
  • You can also mention one of your major achievements, if it fits the circumstance.
  • Keep the answer to just about 3-4 sentences and not more than that.
  • No need to explain your strengths & weakness at this points (as that will definitely come along).
  • A common mistake seen is most HR interview is to start the sentence like “I am basically from...” No need to start a sentence like that.
  • Keep the answer simple, to the point and give space and time for further questions. Do not stretch it too much.
Example:
“Hi I am Kiran and hails from Bangalore. I did my B.Tech in electronics and communication from Rameswara College of engineering, which is under Bangalore University. I had completed my plus two from Chinmaya Vidhya Mission School and secured 98% in CBSE Boards. I have four members in my family and I am the youngest son. I love outdoor sports, specifically athletics and was a member of college athletic team.”

Must read - Awesome examples of Tell me about yourself with best answers

What are your key strengths ?

This is another most common question in any HR interview. The idea here is to understand how much you know about yourself and how confident you are about your strengths.
  • Just stay positive. Even a simple answer like “I am a very positive person” is good enough.
  • You can also change this as per the requirement of the interview. Knowing a bit about the profile you are being interviewed helps as well.
  • Explaining your strength with an experience from the past is desirable here.
Also Read : Awesome examples and tips to answer Strengths and Weaknesses interview question
Example:
  • “Sir, my greatest strength is my ability to learn things quickly. For example, I had to represent my college in an inter college science exhibition, and was introduced to the team at the very last minute. I was able to understand our exhibits and artifacts and present them with great success”.
  • “I think my greatest strength is my positive attitude, even during the most hardest of times. During my college project, there has been couple of occasions, when our idea was not falling in place and the results were negative. I had to believe and think positively and keep my team motivated to persist on our idea, and finally we got the desired result.”
  • “My best skill would be my verbal ability and articulation skill. I have worked as editor for our college magazine and have been involved with various literary forums during my school and college days.

Interview questions for freshers



Q1. Tell us something about yourself.

Strange right?
No one’s asking you about the pros and cons of bipartisan politics. Just something about yourself! And it is not like you are in grave danger of revealing your darkest secrets. Of course you are not going to tell them that your favorite movie is not Shawshank Redemption, as you’d like to claim. It is actually Prem Ratan Dhan Payo!
So why is this so intimidating? Well, ‘coz if you are not prepared, you run the risk of failing on the one question that sets the mood for the rest of the interview.
This question is a classic psychological trap to test how you perceive yourself. You could start with your educational background, where you’ve been brought up, some bit about your parents- the usual facts. But you should be quickly transitioning to your strengths as pertaining to making you a valuable future employee.
Here’s an example.
My name is Gabbar Singh. I was brought up in a village in Chambal. My parents instilled in me the values of honesty, integrity and non-violence. I have always cared for the underprivileged and have helped them several times to organize community festivals like Holi, giving food and aid to small communities. I have even raised money to help out ex convicts, thus giving them a second chance at life. I believe in compassion and helping others. That’s the kind of person I am.
– Says Gabbar, while applying to become the next Thakur of Ramgarh
Emphasize the good you have done, the good you can do and focus on all your positive traits. As a tip, it is always a plus to use strong words like I believe, determined, always, excellent instead of I think, I could, sometimes, maybe or okay. Okay?
 

Q2. Tell us your strengths and weaknesses.

Don’t brag and yet don’t hold back completely. There are the strengths that no one should ideally have any grounds to question you on. For example, unless they have proof of deceit, there is no reason why someone should challenge your claim of being honest and with-integrity.
And then there are the strengths that have to do with skills associated with the job at hand. Be careful there. Only state the ones you are fairly confident in. You can even vaguely scale your knowledge of the skill.
For example, you can say Expert in Coding in Python, Cobra or whatever if you think you can handle any level of counter question on that particular skill. You can say Experienced if you are fairly good but not completely confident enough to handle any question thereto.
Always a good idea to say you are a fast learner. Nothing sounds more like music to an employer’s ears than that.
As for weaknesses, it is better to not show them your cards. And unlike Poker, you are not going to feign a bad hand. Just take one of your good qualities and spin it as if it is a bad thing. I work too hard and my family doesn’t like that. Or say something completely irrelevant like I have a sweet tooth. Like that would matter at your job! Oh well it might if you are applying in a bakery.
However you may want to state your qualities, make yourself desirable as a candidate and approachable like a good coworker.
 

Q3. Where do you see yourself 5 years from now?

If all goes well, sipping a Pina Colada, on a Caribbean cruise. Nope! They want to know your career goals. It is hard for most fresh graduates to look that far ahead when they are still quite unsure about everything else. The best way to answer that is to talk in a bigger picture and leave it somewhat open ended.
Whatever you do, never say in five years I see myself taking your job!!
You could say, for example, that your current goal is to become a part of the Management team (Read these tips to get promoted). You may even want to add a few garnishes of how you want to use your own time to train yourself in skills that may help you become better at your job.
It is not a good idea to give the impression that you would be looking for a way to move away from your hired post, right away. Keep your response aligned with the current post. In other words, you are going to work hard and grow to become more valuable to this company. That has a nice sound bite!
Of course you have to educate yourself well in advance of the possibilities the company offers. That brings us to the next question.
 

Q4. Why do you think this company is a good fit for you?

You need to know what the company does, what its values are, how it has been performing, and any other relevant detail you can get. Then frame the answer in a way that highlights how only this place can help you grow, giving you the opportunities and an excellent platform to reach the career goal you mentioned in the previous question. There are buzz words we all know of. Just be careful to not make your response sound hollow.
I want to join this school because teaching students is the best way to learn and grow.
That’s good but that says nothing about why that particular school.
Instead saying something like this school is well known for being student friendly, creating opportunities for them to excel in their field of choice and producing some of the most creative and successful alumni, in this country. I want to be a part of the process that drives excellence. It will also give me an avenue to grow as a teacher.
Bang on!
 

Q5. Why do you think you are a good fit for us?

What have you got to offer to this excellent organization? Why should we bother to take you on?
And again, play your strengths to them. There is no need to sound like you are the answer to their prayers. You just have to be confident in your ability to contribute well and better than what they can already perceive from your qualifications. It is your desire and passion that counts here. These are typical interviewee emotions that they are looking for. Try to get specific, if you can.
And most of all know the company values and emphasize how they resonate with you. Borrowing the example from the previous question, you probably shouldn’t refer to children as brats, if you want to get hired in that teaching position. The school cares for the children. You should too.
 

Q6. Could you explain the shortcomings on your resume?

It is natural to have a few blemishes in your past and sometimes you just have to include them in your resume (Also read resume writing tips). And it is also quite natural for an interviewer to be curious what happened there. So there is no need make up a fib.
Suppose you have a few D’s or an F or two scattered around. You can simply tell them that you were unprepared, didn’t like the course content or that you were still finding your calling. You can add that you are serious about your career and have learnt the consequence of slacking off.
Just don’t blame someone or something else for it (Read manipulation tricks of coworkers). That would be juvenile and a bad glimpse at what you might do if you fail at work.
 

Q7. Are you a team player?

However much of a disdain, you may have, for mankind, this is not the place to let it out. Most jobs are not meant to be handled alone. Not unless you mime.
Yes is always a safe response. But you don’t need to stop there. You can articulate a response showing that you recognize the importance of team work in an office. Much like the team events you have been a part of until then. No cooperation means no result. Sing to them if you have to.
Ek chidiya, anek chidiya
Post 80’s kids will never know what that is. Just Google Doordarshan, you millenials!
 

Q8. How would you handle a disagreement with authority?

Tied to the previous question but not quite so. While you may work great in a team there is still a possibility that you end up having a disagreement with someone. Management would really like to know whether they would have to babysit or, you know, manage you all the time!
Give an instance from your past. How did you handle a difference of opinion with your teacher, perhaps your parents or anyone you are/were accountable to? Did you decide to not speak up and hope that metabolism alone would take care of that unsettling feeling you are calling acidity?
‘Coz any sensible company would probably not want that. The appropriate response would be to express your concern and dialogue it out. May just turn out that the authority was in the wrong and the company benefitted from your suggestions instead.
 

Q9. What is your salary expectation?

Millions! No seriously, if you are not looking to replace Tata you should probably quote something reasonable. And how do you know what that is? Just look up will ya’? Know what they are likely to offer before you walk in.
If you are a fresher, they will probably not even bother to ask. But just on the off chance they do, know the number and say something close to it. Maybe a little more. At least they’ll know that you didn’t just walk in while wandering around.
 

Q10. Do you have any questions for us, our company?

This is code for The End and could be the last chance to leave a good impression. So ask something intelligent. Not how long are the lunch breaks! It will show a healthy curiosity in the company’s future.
Ask about expansion plans. Or even whether they have any expectations from you before you join. For instance do they want you to familiarize yourself with any tool, to get a head start. Or if you want to close back from where it started, ask them to tell you something about themselves!
You probably understand that what happens inside the interview room is a combination of factors, mostly beyond your control. These are only some of the more popular questions for freshers gathered from the experiences of the have-been-interviewed. While you can never really predict the outcome of those minutes, you can only prepare yourself for the knowns (Also read effective interview skills to learn the techniques to look confident).
Ignore the sweaty palms and the occasionally erratic heart – not unless you start feeling shooting pains in your left arm! Calm down, make eye contact, smile and picture them naked if you have to. Oh wait! No that’s for stage fright!
Take it easy. If it doesn’t go well, maybe this wasn’t it. Just call it a one day stand and keep looking for your one true job.

Saturday 26 August 2017

SAN (storage area network)

What Is a Storage Area Network?

A Storage Area Network (SAN) is a specialized, high-speed network that provides block-level network access to storage. SANs are typically composed of hosts, switches, storage elements, and storage devices that are interconnected using a variety of technologies, topologies, and protocols. SANs may also span multiple sites.
SANs are often used to:
  • Improve application availability (e.g., multiple data paths)
  • Enhance application performance (e.g., off-load storage functions, segregate networks, etc.)
  • Increase storage utilization and effectiveness (e.g., consolidate storage resources, provide tiered storage, etc.), and improve data protection and security.
SANs also typically play an important role in an organization's Business Continuity Management (BCM) activities.
A SAN presents storage devices to a host such that the storage appears to be locally attached. This simplified presentation of storage to a host is accomplished through the use of different types of virtualization.
A Storage Area Network (SAN) is a specialized, high-speed network that provides block-level network access to storage. SANs are typically composed of hosts, switches, storage elements, and storage devices that are interconnected using a variety of technologies, topologies, and protocols. SANs may also span multiple sites.
A SAN presents storage devices to a host such that the storage appears to be locally attached. This simplified presentation of storage to a host is accomplished through the use of different types of virtualization.
Image result for SAN
SANs are often used to:
  • Improve application availability (e.g., multiple data paths)
  • Enhance application performance (e.g., off-load storage functions, segregate networks, etc.)
  • Increase storage utilization and effectiveness (e.g., consolidate storage resources, provide tiered storage, etc.), and improve data protection and security.
  • SANs also typically play an important role in an organization's Business Continuity Management (BCM) activities.
A SAN presents storage devices to a host such that the storage appears to be locally attached. This simplified presentation of storage to a host is accomplished through the use of different types of virtualization.
SANs are commonly based on Fibre Channel (FC) technology that utilizes the Fibre Channel Protocol (FCP) for open systems and proprietary variants for mainframes. In addition, the use of Fibre Channel over Ethernet (FCoE) makes it possible to move FC traffic across existing high speed Ethernet infrastructures and converge storage and IP protocols onto a single cable. Other technologies like Internet Small Computing System Interface (iSCSI), commonly used in small and medium sized organizations as a less expensive alternative to FC, and InfiniBand, commonly used in high performance computing environments, can also be used. In addition, it is possible to use gateways to move data between different SAN technologies.
SNIA is a worldwide source for Vendor Neutral Storage and Information Management Training & Education
SNIA is a worldwide source for vendor neutral training and education on Storage and Information Management technologies and provides an independent understanding of a broad range of Storage and Information Management technologies from basic foundations to advanced techniques.
SNIA’s impartial educational programs enable the IT professional to keep abreast of the rapid technology changes in the industry and enable the community to plan accordingly for the future.


Configuring Nagios Server

Step 1: Install Required Dependencies 




We need to install required libraries like gcc, glibc, glibc-common and GD and its development libraries before installing.
[root@tecmint]# yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel
-------------- On Fedora 22+ Onwards --------------
[root@tecmint]# dnf install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel
Step 2: Create Nagios User
Create a new nagios user account and set a password.
[root@tecmint]# useradd nagios
[root@tecmint]# passwd nagios
Step 3: Install the Nagios Plugins
Create a directory for installation and all its future downloads.
[root@tecmint]# cd /root/nagios
Now download latest Nagios Plugins 2.1.2 package with wget command.
[root@tecmint nagios~]# wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz
Step 4: Extract Nagios Plugins
Run the following tar command to extract the source code tarball.
[root@tecmint nagios~]# tar -xvf nagios-plugins-2.1.2.tar.gz
After, extracting one new folder will appear in that directory.
[root@tecmint nagios ~]# ls -l
total 2640
drwxr-xr-x. 15 root root    4096 Aug  1 21:58 nagios-plugins-2.1.2
-rw-r--r--.  1 root root 2695301 Aug  1 21:58 nagios-plugins-2.1.2.tar.gz
Step 5: Compile and Install Nagios Plugins
Next, compile and install using following commands
[root@tecmint nagios]# cd nagios-plugins-2.1.2
[root@tecmint nagios-plugins-2.1.2]# ./configure 
[root@tecmint nagios-plugins-2.1.2]# make
[root@tecmint nagios-plugins-2.1.2]# make install
Set the permissions on the plugin directory.
[root@tecmint nagios-plugins-2.1.2]# chown nagios.nagios /usr/local/nagios
[root@tecmint nagios-plugins-2.1.2]# chown -R nagios.nagios /usr/local/nagios/libexec
Step 6: Install Xinetd
Most of the systems, its by default installed. If not, install xinetd package using following yum command.
[root@tecmint nagios-plugins-2.1.2]# yum install xinetd
-------------- On Fedora 22+ Onwards --------------
[root@tecmint nagios-plugins-2.1.2]# dnf install xinetd
Step 7: Install NRPE Plugin
Download latest NRPE Plugin 3.0 packages with wget command.
[root@tecmint nagios-plugins-2.1.2]# cd /root/nagios
[root@tecmint nagios]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
Unpack the NRPE source code tarball.
[root@tecmint nagios]# tar xzf nrpe-3.0.tar.gz
[root@tecmint nrpe-3.0]# cd nrpe-3.0
Compile and install the NRPE addon.
[root@tecmint nrpe-3.0]# ./configure
[root@tecmint nrpe-3.0]# make all
Next, install the NRPE plugin daemon, and sample daemon config file.
[root@tecmint nrpe-3.0]# make install-plugin
[root@tecmint nrpe-3.0]# make install-daemon
[root@tecmint nrpe-3.0]# make install-daemon-config
Install the NRPE daemon under xinetd as a service.
[root@tecmint nrpe-3.0]# make install-xinetd
OR
[root@tecmint nrpe-3.0]# make install-inetd
Now open /etc/xinetd.d/nrpe file and add the localhost and IP address of the Nagios Monitoring Server.
only_from = 127.0.0.1 localhost <nagios_ip_address>
Next, open /etc/services file add the following entry for the NRPE daemon at the bottom of the file.
nrpe            5666/tcp                 NRPE
Restart the xinetd service.
[root@tecmint]# service xinetd restart
Step 8: Verify NRPE Daemon Locally
Run the following command to verify the NRPE daemon working correctly under xinetd.
[root@tecmint]# netstat -at | grep nrpe
tcp        0      0 *:nrpe                      *:*                         LISTEN
If you get output similar to above, means it working correctly. If not, make sure to check the following things.
  1. Check you’ve added nrpe entry correctly in /etc/services file
  2. The only_from contains an entry for “nagios_ip_address” in the /etc/xinetd.d/nrpe file.
  3. The xinetd is installed and started.
  4. Check for the errors in the system log files for about xinetd or nrpe and fix those problems.
Next, verify the NRPE daemon is functioning properly. Run the “check_nrpe” command that was installed earlier for testing purposes.
[root@tecmint]# /usr/local/nagios/libexec/check_nrpe -H localhost
You will get a following string on the screen, it shows you what version of NRPE is installed:
NRPE v3.0
Step 9: Configure Firewall Rules
Make sure that the Firewall on the local machine will allow the NRPE daemon to be accessed from remote servers. To do this, run the following iptables command.
-------------- On RHEL/CentOS 6/5 and Fedora --------------
[root@tecmint]# iptables -A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT
-------------- On RHEL/CentOS 7 and Fedora 19 Onwards --------------
[root@tecmint]# firewall-cmd --permanent --zone=public --add-port=5666/tcp
Run the following command to Save the new iptables rule so it will survive at system reboots.
-------------- On RHEL/CentOS 6/5 and Fedora --------------
[root@tecmint]# service iptables save
Step 10: Customize NRPE commands
The default NRPE configuration file that got installed has several command definitions that will be used to monitor this machine. The sample configuration file located at.
[root@tecmint]# vi /usr/local/nagios/etc/nrpe.cfg
The following are the default command definitions that are located at the bottom of the configuration file. For the time being, we assume you are using these commands. You can check them by using the following commands.
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
USERS OK - 1 users currently logged in |users=1;5;10;0
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
OK - load average: 3.90, 4.37, 3.94|load1=3.900;15.000;30.000;0; load5=4.370;10.000;25.000;0; load15=3.940;5.000;20.000;0;
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_hda1
DISK OK - free space: /boot 154 MB (84% inode=99%);| /boot=29MB;154;173;0;193
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs
PROCS CRITICAL: 297 processes
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs
PROCS OK: 0 processes with STATE = Z
You can edit and add new command definitions by editing the NRPE config file. Finally, you’ve successfully installed and configured NRPE agent on the Remote Linux Host. Now it’s time to install a NRPE component and add some services on your Nagios Monitoring Server

On Nagios Monitoring Server

Now login into your Nagios Monitoring Server. Here you will need to do following things:
  1. Install the check_nrpe plugin.
  2. Create a Nagios command definition using the check_nrpe plugin.
  3. Create Nagios host and add service definitions for monitoring the remote Linux host.
Step 1: Install NRPE Plugin
Go to the nagios download directory and download latest NRPE Plugin with wget command.
[root@tecmint]# cd /root/nagios
[root@tecmint]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
Unpack the NRPE source code tarball.
[root@tecmint]# tar xzf nrpe-3.0.tar.gz
[root@tecmint]# cd nrpe-3.0
Compile and install the NRPE addon.
[root@tecmint]# ./configure
[root@tecmint]# make all
[root@tecmint]# make install-daemon
Step 2: Verify NRPE Daemon Remotely
Make sure that the check_nrpe plugin can communicate with the NRPE daemon on the remote Linux host. Add the IP address in the command below with the IP address of your Remote Linux host.
[root@tecmint]# /usr/local/nagios/libexec/check_nrpe -H <remote_linux_ip_address>
You will get a string back that shows you what version of NRPE is installed on the remote host, like this:
NRPE v3.0
If your receive a plugin time-out error, then check the following things.
  1. Make sure your firewall isn’t blocking the communication between the remote host and the monitoring host.
  2. Make sure that the NRPE daemon is installed correctly under xinetd.
  3. Make sure that the remote Linux host firewall rules blocking the monitoring server from communicating to the NRPE daemon.

Adding Remote Linux Host to Nagios Monitoring Server

To add a remote host you need to create a two new files “hosts.cfg” and “services.cfg” under “/usr/local/nagios/etc/” location.
[root@tecmint]# cd /usr/local/nagios/etc/
[root@tecmint]# touch hosts.cfg
[root@tecmint]# touch services.cfg
Now add these two files to main Nagios configuration file. Open nagios.cfg file with any editor.
[root@tecmint]# vi /usr/local/nagios/etc/nagios.cfg
Now add the two newly created files as shown below.
# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
Now open hosts.cfg file and add the default host template name and define remote hosts as shown below. Make sure to replace host_namealias and address with your remote host server details.
[root@tecmint]# vi /usr/local/nagios/etc/hosts.cfg
## Default Linux Host Template ##
define host{
name                            linux-box               ; Name of this template
use                             generic-host            ; Inherit default values
check_period                    24x7        
check_interval                  5       
retry_interval                  1       
max_check_attempts              10      
check_command                   check-host-alive
notification_period             24x7    
notification_interval           30      
notification_options            d,r     
contact_groups                  admins  
register                        0                       ; DONT REGISTER THIS - ITS A TEMPLATE
}
## Default
define host{
use                             linux-box               ; Inherit default values from a template
host_name                       tecmint          ; The name we're giving to this server
alias                           CentOS 6                ; A longer name for the server
address                         5.175.142.66            ; IP address of Remote Linux host
}
Next open services.cfg file add the following services to be monitored.
[root@tecmint]# vi /usr/local/nagios/etc/services.cfg
define service{
use                     generic-service
host_name               tecmint
service_description     CPU Load
check_command           check_nrpe!check_load
}
define service{
use                     generic-service
host_name               tecmint
service_description     Total Processes
check_command           check_nrpe!check_total_procs
}
define service{
use                     generic-service
host_name               tecmint
service_description     Current Users
check_command           check_nrpe!check_users
}
define service{
use                     generic-service
host_name               tecmint
service_description     SSH Monitoring
check_command           check_nrpe!check_ssh
}
define service{
use                     generic-service
host_name               tecmint
service_description     FTP Monitoring
check_command           check_nrpe!check_ftp
}
Now NRPE command definition needs to be created in commands.cfg file.
[root@tecmint]# vi /usr/local/nagios/etc/objects/commands.cfg
Add the following NRPE command definition at the bottom of the file.
###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Finally, verify Nagios Configuration files for any errors.
[root@tecmint]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors:   0
Restart Nagios:
[root@tecmint]# service nagios restart
That’s it. Now go to Nagios Monitoring Web interface at “http://Your-server-IP-address/nagios” or “http://FQDN/nagios” and Provide the username “nagiosadmin” and password. Check that the Remote Linux Host was added and is being monitored.
Nagios Remote Host Monitoring
Nagios Remote Host Monitoring